I have a PDF document to which I want to add internal hyperlinks.
Specifically, page 1 contains a table of contents which I want to make clickable.
My idea is to create rectangular boxes in predetermined locations on page 1, which should link to pages 2, 3, …
I found this post which talks about adding internal hyperlinks using the method I described above.
http://bugs.ghostscript.com/show_bug.cgi?id=691531
However, when I try to use this technique in my file, the script just ADDS pages with the rectangle and hyperlink.
I need it to overlay the hyperlink on the existing contents of my first page.
This is what I used:
Ghostscript function call from MATLAB:
Postscript code saved in script.ps: