Fri Sep 23, 2016 6:29 am
Dim htmlLayoutFormat As New PdfHtmlLayoutFormat() With { _
.IsWaiting = True, _
.LoadHtmlTimeout = 1000000, _
.Layout = PdfLayoutType.Paginate, _
.FitToHtml = Clip.Both _
}
Dim path As String = Dts.Variables("User::PDFName").Value.ToString
Dim setting As New PdfPageSettings()
setting.Size = PdfPageSize.A4
pdf.PageScaling = PdfPrintPageScaling.ActualSize
For Each row As DataRow In dt.Rows
For Each column As DataColumn In dt.Columns
stringhtml += row(column.ColumnName).ToString()
Next
stringhtml += vbCr & vbLf
Next
pdf.LoadFromHTML(stringhtml, True, setting, htmlLayoutFormat)
pdf.SaveToFile(path, FileFormat.PDF)
pdf.Close()
pdf.Dispose()