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

Javascript to replace multiple non-sequential pages

GMT
Registered: Apr 3 2009
Posts: 6

Hello all -

I need to update a large document (3,200 pgs) by replacing 400 non-sequential pages.
The source file will be the same 1-page document.

Can the replacePages call be used without writing a separate line for each page?

Any help or guidance here will be greatly appreciated.

try67
Expert
Registered: Oct 30 2008
Posts: 2399
Only if there's some kind of rule to which pages you need to replace...
Is it each 3rd page? Each page linked to a bookmark? Each page with a certain text? Or what?

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

GMT
Registered: Apr 3 2009
Posts: 6
There's no pattern to the pages that have to be replaced -- they're completely random.
try67
Expert
Registered: Oct 30 2008
Posts: 2399
Then there's no way of doing it except by hard-coding each page number, i.e. writing a separate replacePages() command for each page.

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

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Or you could create an array of pages to replace into and array and then process the array of pages to replace the page by element in the array.

George Kaiser

GMT
Registered: Apr 3 2009
Posts: 6
Sorry for reviving this old thread, but was away on extended leave and am just now getting back to this.

I don’t fully understand how I would go about this using arrays. Can you provide me a simple example of what this might look like?

For example, if I have a ten page document, and I wanted to replace pages 1, 7, & 8 in the first instance, and then, 2, 5,6, & 7 in another instance.Any help would be much appreciated.