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

Batch Process to Insert a Blank page

MIBUK
Registered: Mar 19 2009
Posts: 2
Answered

Hi,

I have 500 individual PDFs. I want to run a batch process, which allows me to automatically insert a blank page at the beginning of each of the 500 PDFs. Can anyone tell me how to do this?

I use Acrobat v8.1.3 Standard running on Windows XP Pro SP3.

Thanks in Advance,
MIBUK

My Product Information:
Acrobat Standard 8.1.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are a couple of different ways to go about this. You could use the "insertPages()" or "newPage()" JavaScript functions. But by far, the easiest way to do this is to use the "insert Pages" Batch command. Just make up a blank page of the correct size. And use this batch command to insert it into your documents.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
Acrobat batch processing is only available with the Professional level versons.

George Kaiser

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Opps, missed that one, Thanks Geroge!

With Standard, you can create a kind of psuedo-Batch process using the IAC, InterApplication Communication Interface for Acrobat.

http://www.adobe.com/devnet/acrobat/interapplication.php

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

SeattleUser
Registered: Nov 21 2008
Posts: 108
Thom/George - is there a way to do this without scripting for those of us who are clueless about scripting?!
daka630
Expert
Registered: Mar 1 2007
Posts: 1420
Thom Parker wrote:
But by far, the easiest way to do this is to use the "insert Pages" Batch command.
Just make up a blank page of the correct size. And use this batch command to insert it into your documents.
As George noted above, you do need Acrobat Pro to run Batch Sequences.
However, Batch Sequences do not require you to create Acrobat JavaScript.

Acrobat Pro permits creation of a blank PDF.
File > Create PDF > From Blank Page.
Once this PDF is saved, you can (as Thom noted) make a Batch Sequence that will insert this page into one or many PDF files.
No scripting; but again, Acrobat Pro is required.

Be well...

Be well...

SeattleUser
Registered: Nov 21 2008
Posts: 108
Thanks daka630 ~ I guess I misread Thom's post. I do have Acrobat Pro and set up a batch process to 'Add Blank Page'. The only part that does not appear to be automated is that I cannot tell it to look for PDFs with an odd number of pages and add a blank page only to those files. I have to manually select each file (with an odd number of pages) to add the blank page to. But this is a step in the right direction!
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You could however do this detection and page adding with a script in a batch sequence.
Here's the code
if(this.numPages & 0x01){var pgRect = this.getPageBox("Crop");this.newPage(this.numPages-1,pgRect[2],pgRect[1]);}

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

SeattleUser
Registered: Nov 21 2008
Posts: 108
Wow! Thom, that's brilliant. Thank you! I had to dig around a little while to figure out how to create the batch script but I finally got it running. Two more quick questions:

1) Is it possible to tweak the script to have the blank page added after all the other pages? Currently, it adds it before the last odd page of the document (e.g. for a 1 page document, it becomes 2 pages: blank1, text2; for a 3 page document, it becomes 4 pages: text1, text2, blank3, text4).

2) Is Javascript something one can pick up very quickly on their own through books, or do classroom time / labs help?

Many thanks!
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The first parameter in the "newPage" function determines the insert point. I thought I already had the location set to the last page. But I guess I was typing little too fast;) This function is a little different from the rest of Acrobat JavaScript, i.e. it's 1 based. Here's the fix.

this.newPage(this.numPages,pgRect[2],pgRect[1]);

Just removed the -1.

As programming languages go JavaScript is pretty simple. But it's still a programming language. How easy it is to pick up depends on your appitude for these kinds of things. The best way to find out is to find an easy entry and try it out. There's lots of info on this site, but it's not too organized.

You'll find some free videos here that cover the basics for PDF. Watch'm and see what you think.
www.pdfscripting.com

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

SeattleUser
Registered: Nov 21 2008
Posts: 108
Thom, you made my week. And probably my next few months! I have some colleagues who just don't like to set up their PDFs right, and this script saves loads of time. I've been dabbling in some basic JavaScript in LiveCycle Designer and watched part of your Adobe MAX 2009 video ~ it seems pretty straightforward; it's just a matter of information retention!

Many, many thanks for the guidance - this script works wonders!