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.

Hyperlinks in DocToPDFConverter

Thread ID:

Created:

Updated:

Platform:

Replies:

125013 Jul 14,2016 10:38 AM Jul 18,2016 11:50 PM ASP.NET MVC 3
loading
Tags: DocIO
Anthony Fitzgerald
Asked On July 14, 2016 10:38 AM

Hi,

Im having an issue with converting hyperlinks from a Word docx to PDF.

It seems to be if the text begins with "http://" or "www.", it will be converted to a hyperlink in the PDF.  If you have chosen to create a hyperlink in Word with custom text (eg. "Google" with a hyperlink to "http://www.google.com"), this is not being converted to a hyperlink in the PDF.

Here are the examples and results:

SUCCESS: http://www.google.com (plain text)

SUCCESS: www.google.com (plain text)

FAIL: maps.google.com (plain text)

FAIL: google.com (plain text)

SUCCESShttp://www.google.com (hyperlinked)

SUCCESSwww.google.com (hyperlinked)

FAILGoogle (hyperlinked)

FAILGoogle (hyperlinked)

I have tested this with http://asp.syncfusion.com/demos/reporting/Pdf/Import%20and%20Export/DoctoPDF/cs/DoctoPDF.aspx and get the same results.

Code im using is below, word document has been attached.

                using (MemoryStream stream = new MemoryStream(wordDocBytes))
                {
                    WordDocument wordDoc = null;
                    wordDoc = new WordDocument(stream, FormatType.Docx);

                    //Initialize chart to image converter for converting charts in word to pdf conversion
                    wordDoc.ChartToImageConverter = new ChartToImageConverter();
                    wordDoc.ChartToImageConverter.ScalingMode = Syncfusion.OfficeChart.ScalingMode.Normal;

                    DocToPDFConverter converter = new DocToPDFConverter();
                    //Convert word document into PDF document
                    PdfDocument pdfDoc = converter.ConvertToPDF(wordDoc);
                    using (MemoryStream outputStream = new MemoryStream())
                    {
                        pdfDoc.Save(outputStream);
                        pdfBytes = outputStream.ToArray();
                    }
                    pdfDoc.Close(true);
                    wordDoc.Close();
                }

Thanks

Anthony

Attachment: Hyperlink_test_ee3992f4.7z

Sethumanikkam Yogendran [Syncfusion]
Replied On July 18, 2016 06:36 AM

Hi Anthony,

Thank you for contacting Syncfusion support.

We have already fixed the mentioned Hyperlink issue in Word to PDF conversion in our latest version. You can download our volume 2, 2016 release from the below link.
https://www.syncfusion.com/forums/124709/essential-studio-2016-volume-2-release-v14-2-0-26-is-available-for-download

Please refer the following link for Word to PDF conversion sample.
http://asp.syncfusion.com/demos/web/docio/doctopdf.aspx

Thanks,
Sethumanikkam.Y
 


Anthony Fitzgerald
Replied On July 18, 2016 09:37 AM

Thank you.

I have updated and all is working as it should.

Thanks again for your help.

Anthony

Sethumanikkam Yogendran [Syncfusion]
Replied On July 18, 2016 11:50 PM

Hi Anthony,

Thank you for your update.

Please let us know if you have any other questions. We will be happy to assist you as always.

Thanks,
Sethumanikkam.Y


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.

;