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

Custom Page insertion via javascript

Zeroh Blue
Registered: Aug 4 2010
Posts: 8

I have been tooling around with javascript to insert pages.
 
Experimenting with either
 
this.insertPages({nPage:1,
cPath:"InsertExampleSource.pdf",
nStart:2 });
 
OR
 
this.insertPages({nPage:0,
cPath:"InsertExampleSource.pdf",
nStart:2,
nEnd:3 });
 
What I am attempting to do is merge two pdf documents and have the pages from the second document follow every other page from the first.
Is this realistic?
 
EXAMPLE:
PDF A has 5 pages
PDF B has 5 pages
 
A1
A2
A3
A4
A5
 
B1
B2
B3
B4
B5
 
After Merge:
 
A1
B1
A2
B2
A3
B3
A4
B4
A5
B5

My Product Information:
Acrobat Pro 9.4.3, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Yes, but not the way you're doing it. You need to use a for-loop to insert the correct page(s) at the correct location(s).

I have created a script that does just that, actually. Have a look here:
http://try67.blogspot.com/2008/12/acrobat-combine-even-odd-pages.php

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com