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

Batch Extract Pages based on Page Size

srprice
Registered: Sep 19 2007
Posts: 138

I'm tring to write a batch javascript that will extract a page based on the the size of the page. We have very large documents with 81/2x11 and 11x17 pages intermingled throughout. I need only to extract the 11x17 pages.

Here is the code that I have but it extracts all the pages. I have been working with the getPageBox size and trying to translate that into a page number using pageNum, but have had no success. Any help could be great appreciated.

/* Extract Pages to Folder */
// A regular expression to acquire the base name of the file.
var re = /.*\/|\.pdf$/ig;
var filename = this.path.replace(re,"");
try
{
for ( var i = 0; i < this.numPages; i++ )
this.extractPages
({
nStart: i,
cPath: "/C/temp/"+filename+"_"+i+".pdf" // change this
});
}
catch (e)
{
console.println("Batch Aborted: " + e )
}

tractionsoftware
Registered: May 3 2007
Posts: 27
I can't answer your javascript question but we have a Acrobat plugin that does all this for you call PDF Page Size Split, see: http://www.traction-software.co.uk/pdfpagesizesplit


lee.
Traction Software
http://www.traction-software.co.uk
srprice
Registered: Sep 19 2007
Posts: 138
Thanks. This software works great. Unfortunately I must accomplish this through a script.

Any other help with the script would be greatly appreciated.

sarah