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.
Unfortunately, activation email could not send to your email. Please try again.

Hyperlink on PDF File

Thread ID:

Created:

Updated:

Platform:

Replies:

91398 Nov 16,2009 02:10 PM Oct 1,2013 12:00 AM ASP.NET Web Forms (Classic) 5
loading
Tags: PDF
Chaouki Zaouia
Asked On November 16, 2009 02:10 PM

How to creat a Hyperlink on a pdf file

Divya G [Syncfusion]
Replied On November 17, 2009 05:20 AM




PdfDocument document = new PdfDocument();
PdfPage page = document.Pages.Add();
PdfGraphics g = page.Graphics;
string html = "http://www.syncfusion.com";
PdfFont font = new PdfStandardFont
(PdfFontFamily.TimesRoman, 2);
PdfHTMLTextElement richTextElement = new
PdfHTMLTextElement(html, font,
PdfBrushes.Blue);
richTextElement.Draw(g, new RectangleF(150, 70, 160, 50));

Chaouki Zaouia
Replied On November 18, 2009 08:36 AM

I am using a vb.net, I need to greate a hyperlink to refere on an other page in tha same document (same as Links on adobe). how to?

Administrator [Syncfusion]
Replied On November 23, 2009 05:06 AM

Hi Chaouki,

We can achieve the link within a document using "PdfDocumentLinkAnnotation".

Please do find the sample from the below specified location and let me know if this helps.

http://help.syncfusion.com/support/pdf.Windows/F91398_VB.zip

Regards,
Divya.G

Juri Parrinello
Replied On September 20, 2013 06:24 AM

Hi there,

I am aware that this is an old post but i tried to download the example using the link provided and i received an error because the resource is no longer there.

I am trying to embed a mailto link in my pdf document, the link has the following format:
    '<a rel='nofollow' href="mailto:juri.parrinello@.kpmg.co.uk?Subject=EmailSubject&Body=EmailBody">Add comments</a>'  

To create the PDF document, I use the following code:
            Dim pdfDoc As New PdfDocument
            Dim MyPage As PdfPage = pdfDoc.Pages.Add()
            MyPage.Section.PageSettings.Margins.Top = 10
            MyPage.Section.PageSettings.Margins.Left = 20

            Dim converter As New HtmlConverter
            converter.EnableHyperlinks = True

            converter.AutoDetectPageBreak = True
            Dim result As Image = converter.FromString(htmlData, ImageType.Metafile, 650)
            Dim pdfImage As PdfImage = pdfImage.FromImage(result)
            Dim format As PdfMetafileLayoutFormat = New PdfMetafileLayoutFormat()
            format.Break = PdfLayoutBreakType.FitPage
            format.Layout = PdfLayoutType.Paginate
            format.SplitTextLines = False
            format.SplitImages = False
            pdfImage.Draw(MyPage, PointF.Empty, format)

Yet, when the pdf document is created, the link looks like a proper link Add comments but clicking it does produce the expected result (opening a new mail) - it looks like i am clicking a plain text.

Would someone be able to assist me with my query?

Kind Regards
Juri Parrinello


Praveenkumar H [Syncfusion]
Replied On October 1, 2013 12:00 AM

Hi Juri,

Thank you for using syncfusion products,

We are not able to reproduce the mentioned issue.
Hence we have attached the generated document.
Please provide us more details about the issue.

Please let us know if you need further assistance,

With Regards,
Praveen


Sample_5af69d6e.zip

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;