• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
2

Add blank page after every page in acrobat

Community Beginner ,
Mar 17, 2021 Mar 17, 2021

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?

 

TOPICS
Edit and convert PDFs

Views

4.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 17, 2021 Mar 17, 2021

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.

 

Votes

Translate

Translate
Community Expert ,
Mar 17, 2021 Mar 17, 2021

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]); 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 17, 2021 Mar 17, 2021

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 17, 2021 Mar 17, 2021

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.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 17, 2021 Mar 17, 2021

Copy link to clipboard

Copied

I'm not sure why I would need to crop or change the page size.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 17, 2021 Mar 17, 2021

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Mar 17, 2021 Mar 17, 2021

Copy link to clipboard

Copied

Thanks. Forgive my ignorance. Works great!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 09, 2024 Apr 09, 2024

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 16, 2024 Apr 16, 2024

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines