Hello,
I encounter
an issue about local link during conversion of RTF file to PDF file.
How to
reproduce the problem:
I convert a RTF document “Input.rtf”
to PDF format.
The RTF document contains
a hyperlink targeting the local file “0200100184200129test.xlsx”.
As relative path, the link
works even if the RTF and linked file are moved in another location.
After conversion, I obtain
the PDF file “OutputUnexpected.pdf”.
Unexpected result: This
PDF file contains a static link including the relative path of JAR execution
context.
Expected result: This
PDF file should contain a local link relative to path of PDF file as shown by
the file “OutputExpected.pdf” (file
obtained by a no Aspose solution).
In the real
project, the above process is done dynamically.
The link in RTF file doesn’t exist. See example: “Input for real projet.rtf”.
Currently, the link is found and replaced by using the following method:
rtfFile.getRange().replace(Pattern.compile("…"), new ReplaceAndFormatEvaluatorDocumentLinks(), true);
I didn’t find any solution to edit the RTF file (with aspose.words library) to obtain
the expected result even by adding the hyperlink in RTF file.
Please,
could you help me to solve this issue?
Thank
you.
Regards
Samuel VILLENEUVE
Sopra group.