Free Support Forum - aspose.com

Possible to replace HTML hyperlink with link annotation?

My situation is this:

We have an HTML file that we convert to a PDF file with Aspose, and then stick it at the beginning of a bigger document. The HTML file has hyperlinks, which continue to work as expected after conversion to PDF.

My wish is to change those hyperlinks to link to other pages within the pdf file instead of opening an external website. Is there a way given the current product to achieve this goal? Thus far I have been unable to isolate the links outside of being able to find the text of the links through a text fragment search which is not as reliable as I need it to be.

@nserror

Thank you for contacting support.

You can get and update hyperlinks in a PDF document. Please visit Working with Links and Actions for your kind reference. In case you still face problems while achieving your requirements, please share a source PDF file along with another PDF file as expected output, so that we may investigate further to help you out.

Thank you. My issue was I was trying to access the link annotations directly after making an HTMLFragment and adding it to a new doc. Because the doc was not saved, it had not yet converted the hyperlinks to link annotations so I was under the impression these links never became link annotations.

After saving the document once I was able to access and replace the annotations. Thank you.

@nserror

We are glad to know that things have started working in your environment. Please feel free to contact us in event of any further query.