Copy link to clipboard
Copied
Hello,
I'm new with scripting in Acrobat, but I'm locking for the way to:
Insert pages from file using a script.
The scenario is:
having a file: xxxx_PR_V01.pdf, I need to insert at the end of the last page in this file another file in the same folder xxxx_TS_V01.pdf.
The xxxx is the name of the folder so.
What do I need to automate this by script?
Thanks
Copy link to clipboard
Copied
Use the "doc.insertPages()" function. Unfortunately the Acrobat JavaScript reference was recently screwed up, so there's no direct link. This will get you close.
https://opensource.adobe.com/dc-acrobat-sdk-docs/library/jsapiref/doc.html#doc-methods
Here's an example, it assumes that "PR_V01.pdf" is open and the current document:
this.insertPages(this.numPages-1,"TS_V01.pdf");
This code can be run from the console window or an automation script:
https://www.pdfscripting.com/public/Automating-Acrobat.cfm