Hi,
you sent me information that the bug is fixed in 11.9.0, but it still persists:
WORDSNET-5933 File name in hyperlink URL gets corrupted when exporting to PDF
See following code creating a PDF document with a hyperlink to an external document which has a greek name (τεστ.pdf):
Document document = new Document(); DocumentBuilder builder = new DocumentBuilder(document); builder.insertHyperlink(“Test”, “D:\Data\Customers\\u03c4\u03b5\u03c3\u03c4.pdf”, false); //“Test” in greek letters
Thanks for your inquiry. I have managed to reproduce the same issue at my side. I have logged this issue as WORDSJAVA-649 in our issue tracking system. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.
Thanks for your inquiry. While using the latest version of Aspose.Words for Java i.e. v11.10.0 and the following code, I was unable to reproduce this issue on my side. I have attached the Pdf file (out.pdf) i.e. generated on my side here for your reference:
Document document = new Document();
DocumentBuilder builder = new DocumentBuilder(document);
builder.insertHyperlink(“Test”, “D:\Data\Customers\\u03c4\u03b5\u03c3\u03c4.pdf”, false);//“Test” in greek letters document.updatePageLayout(); //?? document.save(“C:\Temp\out.doc”, com.aspose.words.SaveFormat.DOC);//ok document.save(“C:\Temp\out.docx”, com.aspose.words.SaveFormat.DOCX);//ok document.save(“C:\Temp\out.pdf”, SaveFormat.PDF);//still broken
Please make sure if you’re referencing the latest Aspose.Words’ library in your project.
in the created document it looks pretty&correct, but by clicking the hyperlink the referenced document does not open. Please see attached dialog (sorry, it’s in German due to my German Windows7): the special characters are encoded (which seems correct) but the file is not found although it’s stored at the specified place. So I think there’s still something wrong with the link inside the PDF document.
Thanks for sharing the details. Please note that Aspose.Words tries to mimic the same behavior as MS Word do. If you insert the same link in MS Word document and convert that document to PDF by using MS Word, you will get the same behavior. I have attached the output PDF file with this post generated with MS Word.
Hope this answers your query. Please let me know if you have any more queries.
Hi Tahir, thanks for your quick help. In this case this seems to be a bug in Adobe reader and your PDF output is correct. I really appreciate using aspose.words, which is a great product.