Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Insert doc after every 2 pgs

New Here ,
Oct 11, 2017 Oct 11, 2017

I need to insert a document containing several pages into another document after every certain amount of pages.

For example, my destination document is a 200-page document containing 100 2-page letters that I have to print out. Each letter will contain two enclosures that are in a source pdf file. Currently, I have to drag and drop the source file into the destination file behind each individual letter to get it ready for printing.

I have been trying to write a script that will do this tedious work for me, but I am so green and I'm running into so many roadblocks. If anyone out there can point me in the right direction, I would greatly appreciate it.

TOPICS
Acrobat SDK and JavaScript , Windows
327
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 11, 2017 Oct 11, 2017

Basically, you would need to write a loop that inserts the pages into the target PDF using the insertPages command. This is a bit tricky, though, because each time you insert pages the total amount of pages in the target file changes and your code needs to take that into consideration.

If you're interested, I've developed a tool that allows you to do this task easily and without having to write any code yourself.

You can find it here: Custom-made Adobe Scripts: Acrobat -- Insert One PDF File Into Another Multiple Times

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 12, 2017 Oct 12, 2017
LATEST

If you do decide to write it yourself here's a tip. When you insert or delete pages in a loop you get a headache really quick. The solution is to work backwards from the end of the file, so that all the work you've already done doesn't affect the pages still to do.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines