Skip to main content
Participant
August 5, 2023
Question

Inserting an existing pdf into another pdf every nth page

  • August 5, 2023
  • 1 reply
  • 556 views

Hi friends, I have a project where I have 100 page pdf that I will eventually split into 50 separate files. Basically it's a batched pdf with 50 different 2 page documents. Splitting it is the easy part, however, every document also needs a standardized page 3 and 4. In the past I've just done this manually, but it is such a time suck. Is there a way to write a script and loop it so I don't have to run the same action 50 times? Any help or insight would be greatly appreciated. 

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
August 5, 2023

Yes, this can be done using a script. If you're already splitting the files it might be easier to do it after the split, though.

Create an Action that executes this JS code (don't forget to add a Save command, too!), and then run it on your files:

 

this.insertPages({cPath: "/C/MyFiles/PDFs/File to insert.pdf", nPage: this.numPages-1});

 

Replace the dummy file path I used with the actual one, but make sure to use the same syntax!

 

If you do want to do it in the original file it will require a more complex script, like this (paid-for) tool I've developed exactly for this purpose: https://www.try67.com/tool/acrobat-insert-one-pdf-file-into-another-multiple-times