Copy link to clipboard
Copied
I have a security work shift log MSWord file of which a separate file gets filled out by each subsequent shift. My goal is to create a single file for all future shift logs to be contained. I have created a form file and have added a button at the bottom of the form file page which should invoke the following insert new file javascript when clicked on:
this.insertPages({nPage:this.numPages-1, cPath:"log-template.pdf"});
However, after exiting the form editor and saving the file, I click on the button and nothing happens. Both the source and the insert (Log-Template) document forms are in the same directory. Please assist. Files are attached...
Thanks, David
Copy link to clipboard
Copied
Open the JS Console (Ctrl+J) and you'll see an error message after clicking the button.
The reason is this method require a trusted context to run, such as a folder-level script. If you're the only one who's going to use it, then you can create this script file and install it on your machine and then it would work.
If others need to use it, too, then you would have to do the same on their machines, as well. Oh, and it won't work in Reader, only in Acrobat.
Another option is to create a (hidden) Template page from this file, and then spawn copies from it when new pages are needed. This would not require installing a script file, and would work in Reader.
Copy link to clipboard
Copied
As noted by Try67, the correct way to add pages to a PDF is to use a Page Template.