Home > front end >  After deleting a page from a PDF file, the interdocument hyperlinks are broken. How to prevent/avoid
After deleting a page from a PDF file, the interdocument hyperlinks are broken. How to prevent/avoid

Time:03-19

Basically the title: When I remove a page at the beginning of a PDF file that has hyperlinks/cross-references, the hyperlinks/cross-references—which are defined with absolute (and not relative) page numbers—are messed.

For instance, when I open enter image description here

However, if I remove the first page of the document (which is a cover I want to get rid of), the link again takes me to the 8th page of the new document (p. 827). The same is the case for citations.

Is there a way to prevent that from happening when removing a page from the PDF?

Thanks in advance.

CodePudding user response:

The links in the PDF file are defined properly. If I remove the first page with Acrobat or our tools, the links still work correctly.

This might be a problem with your PDF editor, it might transform internally the page references to absolute page numbers.

Update: Link annotations Your annotation is the 505 object. Its /Dest entry (an array) specifies the link target and the first element is the destination page which is defined as a reference to the page object, the 72 object which is the following page. So no mater how pages are added or deleted the link will point to the correct destination page.

Your PDF viewer might turn internally this page reference into an absolute page number so when pages are deleted the link no longer points to the correct page.

  • Related