These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Merging a file

aaronl
Registered: Jul 13 2008
Posts: 4

I tried searching, but couldnt find exactly what I needed, so hopefully you guys can help.

basically I have 2 files that need to be merged... a coversheet and then the worksheets that go along with that specific sheet.

basically my thoughts are this.

I open the coversheet, named SWM12345TC.pdf. run the script.

script pulls the filename, and removes the last 6 characters (TC.pdf) and saves that as a variable.

then adds in the second file, SWM12345W.pdf. (which it would add by using the variable from the original + W.pdf on the end.

merges the two and saves it as the variable + .pdf (SWM12345.pdf).

closes the original and opens the new file (SWM12345.pdf) which then lets me edit away....

I know I could simply do it with the merge feature, but when I do this all day long for 9 hours if there was a way i could shave off 30 seconds per file, it would help a lot.

Hopefully you guys can help

My Product Information:
Acrobat Standard 8.1.2
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
Two methods you should study are the "insertPages" and "saveAs" methods of the doc object. You'd probably want to run the code from a custom menu item, or maybe a batch sequence. Also look into the "closeDoc" and "app.openDoc" methods. The other stuff is straightforward string processing.

George