Skip to content

Instantly share code, notes, and snippets.

@felixlindemann
Created February 4, 2014 12:53
Show Gist options
  • Save felixlindemann/8803061 to your computer and use it in GitHub Desktop.
Save felixlindemann/8803061 to your computer and use it in GitHub Desktop.
create Duplicate Pages Acrobat XI OSX
function duplicatepages() {
try {
var r = this.getPageBox();
var w = r[2] - r[0];
var h = r[1] - r[3];
var oldD = this;
var newD = app.newDoc({ nWidth: w, nHeight: h });
for(var p=oldD.numPages-1; p>=0; p--) {
pageFile = "/Volumes/Daten/tmp/acrobat/"+"page.pdf";
oldD.extractPages({ cPath: pageFile, nStart: p });
newD.insertPages({ cPath: pageFile, nPage: -1 });
newD.insertPages({ cPath: pageFile, nPage: -1 });
// File.delete(pageFile);
}
return true;
}
catch(e)
{
app.alert("Processing error: "+e)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment