Copy link to clipboard
Copied
I need to add a blank page between every page in my file(s).
What is the JavaScript I use in the Action Wizard to accomplish this?
Hi,
So just wrap it in a loop, something like
for ( var i = this.numPages; i > 0; i--){
var Rect = this.getPageBox("Crop");
this.newPage(i, Rect[2], Rect[1]);
}
Although depending on the setup of your file you might need to change the How you get the page Size.
Copy link to clipboard
Copied
Hi,
This would probably only work in the full Acrobat product, but you can use the newPage method from the Document object.
(from js_api_reference)
Add a new page to match the page size of the doc.
var Rect = this.getPageBox("Crop");
this.newPage(0, Rect[2], Rect[1]);
Copy link to clipboard
Copied
I don't think I was clear. I have a 500 page file, and I need to add a blank page after each page, making it a 1000 page document.
I have Acrobat DC.
I used to have an Action Wizard shortcut to do this, but it was deleted when Adobe "accidentally" deleted my account & I had to re-install my apps.
I remember setting up the Action Wizard using JavaScript.
Copy link to clipboard
Copied
Hi,
So just wrap it in a loop, something like
for ( var i = this.numPages; i > 0; i--){
var Rect = this.getPageBox("Crop");
this.newPage(i, Rect[2], Rect[1]);
}
Although depending on the setup of your file you might need to change the How you get the page Size.
Copy link to clipboard
Copied
I'm not sure why I would need to crop or change the page size.
Copy link to clipboard
Copied
It doesn't do that. It reads the size of the first page and then adds a blank one in the same size.
If you want all the pages to just have the same size that's possible too, but then you'll need to tell us what that size is so we could adjust the script, but the one provided by @BarlaeDC should work just fine.
Copy link to clipboard
Copied
Thanks. Forgive my ignorance. Works great!
Copy link to clipboard
Copied
That is brilliant, thank you. Now is there a way to add a Guide line on each page such as 0.5 inch?
Thank you in advance for your insights. 🙂
Nancy
Copy link to clipboard
Copied
Hi,
There is not really a way to add a guide, I guess you could add a line annotation (this.addAnnot) but it would be an annotation on top of the page as opposed to a guide