We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Links not showing even when EnableHyperlinks = True

I am outputting a pdf from an html string. The only string I am passing is a link Go to page

It makes it look like a link on the outputted pdf but it is not clickable.

Here is some code:

Public Class PdfUtils
Public Sub New()

End Sub

Private Globalhtml As String
Private GLobalimage As Image


Public Sub ConvertHtmlStringToPDF(html As String, ByRef page As PdfPage)
Globalhtml = html
Dim t As Thread = New Thread(New ThreadStart(AddressOf ConvertFromString))
t.SetApartmentState(ApartmentState.STA)
t.Start()
t.Join()
Dim metafile As PdfMetafile = New PdfMetafile(GLobalimage)

metafile.Quality = 100

Dim format As New PdfMetafileLayoutFormat
format.Break = PdfLayoutBreakType.FitPage
format.Layout = PdfLayoutType.Paginate
format.SplitTextLines = False


metafile.Draw(page, New PointF(0, 0), format)
End Sub


Private Sub ConvertFromString()
Dim html As New HtmlConverter
html.EnableHyperlinks = True
GLobalimage = html.FromString(Globalhtml, ImageType.Metafile, 900, -1, AspectRatio.KeepWidth)

End Sub


1 Reply

SM Suresh M Syncfusion Team July 1, 2011 05:25 AM UTC


Hi Daniel,

Thank you for your interest on Syncfusion products.

Please use the HtmlToPdfResult.Render method to get the HTMLConverter options such as Hyperlinks, PageBreaks instead of drawing metafiles in the PdfPage. Please refer to the sample available in the link below.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=HtmlToPdf658253704.zip

Please let us know if you have any queries.

Regards,
Suresh M



Loader.
Live Chat Icon For mobile
Up arrow icon