Copy link to clipboard
Copied
I have a PDF File with (2) PDF attachments. On the PDF File, I created links to each of the other PDF attachments. On each of those PDF attachments, I would like to add a button or link that will take the user back to the Main PDF File without having to use View -> Navigation -> Previous View manually. I can't seem to find a way outside of implementing Javascript.
Any ideas? I have no problem using Javascript, I just don't know how to code that. If someone has the code and would like to share it, that would be great!
Copy link to clipboard
Copied
This has to be done with a script, which means it will only work in Acrobat.
It would be nice if there was something like an oDoc.parentDoc parameter, but there isn't. Documents that are opened in acrobat are not aware of any containing PDF and act independently
There is however a solution. The path of an attachment includes the path to the parent file. So one solution is to extract the path to the parent file and open it. Since it's already open it will be moved to the front.
Another solution is to use the use the parent path to find the parent PDF in the app.activeDocs array, and then bring it to the front with the "doc.bringToFront()" function. However, this will only work from a privileged script or if the parent pdf is "disclosed".
Copy link to clipboard
Copied
Make the attachment open in a new window, so the user only has to close the new window to return to the first one.
And so your "Back" button should just close the active document.
Use this in a Document script to force attachments to open in a new window:
app.openInPlace = false;