We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Save to Pdf deletes hyperlynk

Hi we are using the Save function of Aspose.Word but when save it as PDF, some hyperlinks are deleted.


Dim pdfOptions As New PdfSaveOptions()
pdfOptions.ImageCompression = PdfImageCompression.Auto
pdfOptions.OpenHyperlinksInNewWindow = True
doc.Save(path & “D_25.pdf”, pdfOptions)

The hyperlink are not deleted only when the full path is the name AND it contains "www"
In all the other case, the hyperlink is replaced by a outlined text.

Any help would be appreciated, is it a known bug like this one:
Converting a PDF to HTML removes hyperlinks

Is there a workaround we can use?

Hi Gauthier,

Thanks for your inquiry. In case you are using an older version of Aspose.Words, I would suggest you please upgrade to the latest version (v14.8.0) from here and let us know how it goes on your side. If the problem still remains, please attach your input Word document here for testing. Please also share the hyperlinks which are deleted in output Pdf file. I will investigate the issue on my side and provide you more information.

We are already using the 14.8 version


Please find attached the docx file.
The working links are #1 and #3
The other links are not working and replaced by a blue outlined text

Hello,

This probem is very important and its fix would be very appreciated because a lot of our clients integrate such hyperlinks in their doc/docx documents.

May be you have any idea on a possible workaround ? This could be very helpful for us, and it could give you more time to provide a complete fix.

Best regards.

S. Moinard, CTO.
QUALNET

Hi Gauthier,

Thanks for sharing the detail. I have tested the scenario and have not found the shared issue while using latest version of Aspose.Words for .NET 14.8.0. I have attached the output Pdf file with this post for your kind reference. All links are working fine in output Pdf file. Could you please attach your Pdf file along with following detail for investigation purposes?

What environment are you running on?

  • OS (Windows Version or Linux Version)
  • Architecture (32 / 64 bit)
  • .NET Framework version

Hi Tahir


I checked the result and the result is not ok. You have the same problem as we here with the links:
the link “Mon lien qui va marcher : clic ici: f” is supposed to open http://www.google.fr, in the output pdf file it’s only a blue outlined text and not an hyperlink. Only 2 links from 6 are working in your output pdf file.
Is it working on your side?

We are using Windows 7, Word 13 and Adobe PDF Reader 11
Our two applications are using the .Net frameworks 2.0 or 4.0

Any idea would be appreciated

Hi


I found out that the links are working when we are using a stand-alone pdf reader.
But it’s not working when we open the files with our explorer’s reader (for example Chrome).
We will run several test on our explorers and i’ll let you know the results

Hi Gauthier,

Thanks for sharing the detail. I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-10842. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi Gauthier,

Thanks for your patience. It is to inform you that our development team has completed the work on the issue (WORDSNET-10842) and has come to a conclusion that this issue and the undesired behavior you’re observing is actually not a bug in Aspose.Words. I am quoting developer’s comments here for your reference:

OpenHyperlinksInNewWindow uses JavaScript code app.launchURL(“URL”, true) for hyperlinks. I found in Internet many links that this code is not working in Chrome and some other browsers.

However all links from generated Pdf document are opened in Internet Explorer (and stand alone Pdf viewers). So it’s not a bug of Aspose.Words.

Your should use PdfSaveOptions.OpenHyperlinksInNewWindow = false if document is to be opened in Chrome or other browser. There is no meaning to use PdfSaveOptions.OpenHyperlinksInNewWindow = true for Chrome because even working links (1 and 3 from source document) are opened in the same window, not in new. In contrast Internet Explorer opens this links in new tabs if option is true.