Hyperlinks in PDF from Word

Hi Aspose!

In Word you can add hyperlinks to external http-adresses. In the Word 2013 dialog you have a button callet “Target frame” where you can choose from some different targets like New Window or _blank.

Using this feature we still don’t get any change in the way the links work from the Aspose generated PDF using your version Word 13.5.0.0. See also attached file (sorry for Swedish Word version)

Do you support this feature or not. I it supported in later versions or are we doing something wrong.

Looking forward to your response.
Rikard Blomquist
Barium AB

Hi Rikard,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. If you convert your document to Pdf using MS Word, you will get the same output. Please create a Word document with hyperlinks having “target frame” and convert it to Pdf using Aspose.Words and MS Word and check the output. Both output Pdf files will be same.

Could you please share some detail about your requirements along with expected output Pdf file? We will then provide you more information on this.

Hi

We are using ASPOSE to convert Word-files into PDF and showing Word-files as PDF:s embedded (see attached pic) in our webapplication (a document management system) and I was posting the question as our users would like to have a behavior in the system that when you click a hyperlink in the PDF (converted from a Word-file) they would like the link target to open in a new window instead of taking over the frame where the PDF was visable.

Since there is a hyperlink setting in word (view former post) target frame = new window or _blank they are expecting this from the PDF.

I was wondering if you are supporting this or plan to in a future release?

BR
Rikard

Hi Rikard,

Thanks for sharing the detail. Please use PdfSaveOptions.OpenHyperlinksInNewWindow property to set/get a value determining whether hyperlinks in the output Pdf document are forced to be opened in a new window (or tab) of a browser.

The default value is false. When this value is set to true hyperlinks are saved using JavaScript code. JavaScript code is app.launchURL(“URL”, true);, where URL is a hyperlink.

Note that if this option is set to true hyperlinks can’t work in some PDF readers e.g. Chrome, Firefox.

Hope this helps you. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "in.docx");
PdfSaveOptions options = new PdfSaveOptions();
options.OpenHyperlinksInNewWindow = true;
doc.Save(MyDir + "Out.pdf", options);