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

Free Support Forum - aspose.com

.docx export to pdf, hyperlinks on fields stripped

When saving docx document to SaveFormat.PDF - Hyperlinks are not functioning when they are on CrossReference field even if Hyperlink styling is preserved on PDF.
Code snippet :

Document wpd = new Document("./src/main/resources/input.docx");
wpd.save("./src/main/resources/output.pdf", SaveFormat.PDF);

input.docx (12.5 KB)
output.pdf (60.3 KB)
attaching input.docx and output.pdf file.

Using this aspose.words version:
https://releases.aspose.com/java/repo/com/aspose/aspose-words/23.1/

@ANDREA.FARRIS since Aspose.Words API try to replicate the MS Word application behavior, this is the expected output. The resultant PDF is equal to the PDF that you obtain saving the document using MS Word application.
wordOutput.pdf (8.9 KB)

It’s partly true, exported PDF using Word application preserves link when it has additional text around CrossReference. link is functional even over crossRef field in this case.

@ANDREA.FARRIS sorry, I miss that, in the Aspose.Words generated PDF the “1” in “textBefore1textAfter” is formatted as a link, but it’s not a link. I will raise this problem to be evaluated by our development team.

@ANDREA.FARRIS
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-25127

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@ANDREA.FARRIS Please note, MS Word behaves the same way: ms.pdf (8.8 KB)
As you can see in the MS Word produced PDF the mentioned hyperlink also does not work.

@alexey.noskov Hyperlink that has text around CrossReference field is fully functional on your provided pdf, including text from cross reference field (when using aspose words the text part that comes from crossReference field is not functional)
(second hyperlink in provided document)

I agree that if Hyperlink text contains only CrossRefence (no additional text), output is same as MS Word. (3rd hyperlink in provided document)

@ANDREA.FARRIS Thank you for additional information. Yes, we have noticed this. Our development team will further investigate the issue. We will keep you posted and let you know once the issue is resolved or we have more information for you.