Automating changing link to open an attachment
Hi,
We've got a PDF that needs distribution to customers, and we'd like to include a CSV file as an attachment and also update one link in the PDF to open the attachment (by default, this link in the PDF is a web link to an external version of the CSV file that lives in the same directory as the PDF).
As this PDF gets rebuilt often, I'd like to be able to make a one button action/command to attach the CSV file and then update the link to open the attached file instead of a web link to the external file.
Part one I have managed to do easily enough. However, I can't work out how I could achieve the following with an Action/Command in Acrobat:
1. Find the link text in the PDF (my.csv)
2. Automatically change the link action from "Open a web link: my.csv" to
Run a Javascript:
/* Launch attached CSV file */
this.exportDataObject({cName: "my.csv", nLaunch: 2});
So, that little bit of JavaScript above does exactly what I want it to do, I just want to be able to click an Action/Command button and find the text and change the existing link to behave like in step two. It feels like I should be able to change the link behavior with JavaScript, but I am really struggling to work out how!
Any help, much appreciated.
