Script to add a page to a PDF
I have a script that extracts and renames files that have been extracted.
What I require is during the process I wish to add a page to the beginning of the extracted Files and have it say something like, "Part 1 of 2".
var re = /\.pdf$/i;
var filename = this.documentFileName.replace(re,"");
try {for (var i = 0; i < this.numPages; i+= 5) this.extractPages({
nStart: i,
nEnd: (((i+4)>=this.numPages) ? this.numPages-1 : (i+4)),
cPath: "/K/Penta/Split/"+filename+"_" +"Pages_" + (i+1) + "-" + (((i+5)>=this.numPages) ? this.numPages : (i+5)) +".pdf"
});
} catch (e) { console.println("Aborted: " + e) }
The Script extracts a set number of pages and saves them with their new name
Message was edited by: Joshua Adams
