Hello,
When i convert HTML to pdf, the pdf text is not selectable. (it is like an image)
How can i achieve that?
Code:
Private Sub HtmlToPDF()
Dim doc As PdfDocument = New PdfDocument()
Dim setting As PdfPageSettings = New PdfPageSettings()
setting.Size = New SizeF(800, 1148)
setting.Margins = New Spire.Pdf.Graphics.PdfMargins(20)
Dim htmlLayoutFormat As PdfHtmlLayoutFormat = New PdfHtmlLayoutFormat()
htmlLayoutFormat.IsWaiting = True
Dim url As String = "mijnurl"
Dim thread As Thread = New Thread(Sub()
doc.LoadFromHTML(url, True, True, True, setting, htmlLayoutFormat)
End Sub)
thread.SetApartmentState(ApartmentState.STA)
thread.Start()
thread.Join()
doc.SaveToFile("e:\tmp\tmp.pdf")
doc.Close()
System.Diagnostics.Process.Start("e:\tmp\tmp.pdf")
End Sub
Thanks!