Hyperlinks updated when document converted from DOCX to PDF

Hello,

We have noticed that hyperlinks within certain documents are updated when converted from DOCX to PDF.

OS version: Windows 10 Pro (Version: 21H2, OS build: 19044.1889)
Target framework: .NET Framework 4.8
Aspose.Words version: 19.8.0.0

Content file: JPDOC.docx (32.6 KB)

fileName = "\\Lt-manolovk\c\Development\SystemDirectory\IRMSSD_KRASS\AttachmentDocs\JPDOC.docx"
destinationFile = "\\Lt-manolovk\c\Development\SystemDirectory\IRMSSD_KRASS\EmailAttachments\34425\2022-9-7-153\JPDOC.pdf"

Aspose.Words.Document document = new Aspose.Words.Document(fileName);
document.Save(destinationFile);

Do you have any suggestions on how we can resolve this issue?

Thank you!

@kmanol Could you please elaborate the problem in more details? I have tested conversion using the following code on my side:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.pdf");

and the output PDF produced by this code fully matches PDF document produced by MS Word on my side.

By default Aspose.Words updates fields in the document upon conversion document to PDF. You can disable this using code like the following:

Document doc = new Document(@"C:\Temp\in.docx");
PdfSaveOptions options = new PdfSaveOptions();
options.UpdateFields = false;
doc.Save(@"C:\Temp\out.pdf", options);

But this code produces exactly the same output as the previous one with your input document.

@alexey.noskov

My apologies! The exact issue is that the hyperlinks contained within Reference 1 and Reference 2 (pages 2-3) of the DOCX appear to be updated when the document is converted into a PDF:

Reference 1
DOCX: https://www.info.pmda.go.jp/fsearchnew/fukusayouMainServlet?scrid=SCR_LIST&evt=SHOREI&type=1&pID=6399427&name=%A5%E9%A5%D6%A5%EA%A5%BA%A5%DE%A5%D6&fuku=%C6%AC%C4%CB&root=3&srtnendo=2&rdoMatch=false&page_max=100&page_no=0
PDF: https://www.info.pmda.go.jp/fsearchnew/fukusayouMainServlet?scrid=SCR_LIST&evt=SHOREI&type=1&pID=6399427&name=%25A5%25E9%25A5%D6%A5%EA%A5%BA%25A5%DE%A5%25D6&fuku=%C6%AC%25C4%25CB&root=3&srtnendo=2&rdoMatch=false&page_max=100&page_no=0

Reference 2
DOCX: https://www.info.pmda.go.jp/fsearchnew/fukusayouMainServlet?scrid=SCR_LIST&evt=SHOREI&type=1&pID=6399427&name=%A5%E9%A5%D6%A5%EA%A5%BA%A5%DE%A5%D6&fuku=%C8%AF%C7%AE&root=3&srtnendo=2&rdoMatch=false&page_max=100&page_no=0
PDF: https://www.info.pmda.go.jp/fsearchnew/fukusayouMainServlet?scrid=SCR_LIST&evt=SHOREI&type=1&pID=6399427&name=%25A5%25E9%25A5%D6%A5%EA%A5%BA%25A5%DE%A5%25D6&fuku=%C8%AF%C7%AE&root=3&srtnendo=2&rdoMatch=false&page_max=100&page_no=0

@kmanol Thank you for additional information. I have checked on my side and looks like the problem is not reproducible using the latest 22.9 version of Aspose.Words. Hyperlinks in the source DOCX and in the output PDF documents are identical.
Could you please attach your output PDF here for our reference?

@alexey.noskov

Thank you for the quick response!
Here is the PDF file: JPDOC.pdf (114.4 KB)

I’ll create a sample application with a reference to the latest version of Aspose Words and try again.

@alexey.noskov

I was able to confirm that …
Aspose.Words 19.8.0 - issue occurs
Aspose.Words 22.9.0 - issue does not occur

This is great news! However, some of our clients are on older versions of our software and may ask for a workaround to this issue … Do you know why this is occurring and/or how to avoid it? (aside from upgrading)

Thank you!

@kmanol Unfortunately, there is no workaround of this issue in 19.8 version of Aspose.Words. So the only solution is upgrading to the latest version of Aspose.Words.

@alexey.noskov

Understood. Thank you for the support!

1 Like