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

If/then/else script for numbering pages in a footer

michaelthopkins
Registered: Feb 11 2008
Posts: 13
Answered

I have never coded in javascript before so I ask this not knowing whether it is a viable option. Any help pointing me in the right direction would be appreciated. I am in the JAG corps and I am trying to automate stamping prosecution exhibits to save me anywhere from minutes in a case to hours.

I am trying to come up with a script/batch process that will do the following...

I want Acro 9 to look into a folder, take the PDFs within and if the document is a single page insert a footnote in the lower right corner stating:

Prosecution Exhibit ___ for ID
Offered ____ / Admitted ____

else if it is a multi-page document, insert a footer where the middle footer will have on all pages "Page x of y" and in the lower right corner have the above referenced document.

Then have the documents re-named so they don't over-write the originals.

What would be the icing on the cake is if the code could then either place them all in a pdf binder or portfolio so that I could print them at a later time all at once.

It seem that I could do the last two from the batch process but I am not sure on coding the first part.

Thanks in advance...

My Product Information:
Reader 9.0, Windows
George_Johnson
Expert
Registered: Jul 6 2008
Posts: 1876
There are a number of approaches you could take to accomplish what you want, so it is all possible.

If you use a batch process, you can set it up so that the documents are automatically renamed and/or relocated after the documents are processed.

To add the content to the pages, you can use form fields, page templates, watermarks (aka Layers, aka OCGs), or comments (annotations). For the static content I'd be inclined to add it using templates. For the "page x of y", probably watermarks. If you use form fields or comments, you would probably want to then flatten the pages as well. See the JavaScript Corner articles here by Thom Parker for a lot of great information on a lot of this, particularly his article on Layers.

You can also print all of the documents in a particular folder using a batch sequence that comes with Acrobat, so you do not need to bother setting up a portfolio just for this. You can organize the files in folders instead.

George
michaelthopkins
Registered: Feb 11 2008
Posts: 13
Thanks so much for the quick response and the direction.