I found the following code to use in creating a Batch Sequence to extract pages from a multi-page pdf file.
It works fine, but it creates a separate file for each single page, naming them Extract001.pdf, Extract002.pdf, etc.
I need to know how to modify this code so the Batch Processing Sequence will save 3 pages at a time per file (1st file is pages 1-3 of the original pdf, 2nd file is pages 4-6, etc.).
==Begin==
var filename = "Extract";
var nihe=1;
try {
for ( var i = 0; i < this.numPages; i++)
this.extractPages
({
nStart: i,
cPath: filename+ util.printf("%03d",i+nihe) +".pdf"
});
} catch (e) { console.println("Aborted: " + e) }
==End==
Can someone help?
Thank you.
* 1st page to be extracted.
* Last page to be extracted.
* Name of the file to be generated, which these pages will be placed into.
The scripting simply needs to be adjusted to increment in steps of 3 instead of steps of 1, so an additional variable (other than 'i') is required to keep track of the page numbers. Don't forget to keep checking for EOF (end of file) in case the number of pages is, for some reason, not a multiple of 3.
The tutorial on this site may be very useful to you!Hope that helps!
DaveyB
LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB