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

how to use VB to bates stamp an Acrobat file.

Marceepoo
Registered: Sep 26 2007
Posts: 7

I spent more hours than I care to admit, re-reading and re-reading The JavaScript Specification Manual for writing scripts, trying (in vain) to figure out how to use VB to bates stamp an Acrobat file. I was trying to learn how to use Javascript to automate bates stamping of pdf files.

I'm very comfortable with vbscript, and beginning to learn how to use VB.Net.
Does anyone know where can I find an example in which some form of VB is used to bates stamp an Acrobat file (presumably by triggering a javascript [which I understand is the only program that be used natively w/in Acrobat to automate operations such as stamping])?

For example, here's one thing I would like to do:

Filenames beginning w/ "Ex.01" in a directory (or listed in a txt or csv file) get stamped in the bottom margin as follows:
Exhibit 01, pg. 1 (...page X)

Filenames beginning w/ "Ex.02" in a directory (or listed in a txt or csv file) get stamped in the bottom margin as follows:
Exhibit 02, pg. 1 (...page X)

Thanks,
Marceepoo

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Bates stamping, from the scripting perspective, is simply adding some text to either the top or bottom of a page. Unfortunately there isn't a "MakeBatesNumbers()" function in Acrobat JavaScript, but there are a couple of ways to do this. By adding either a text field or a text annotation. Form fields are easier to deal with.

Here are some articles that will help.

http://www.acrobatusers.com/tutorials/2007/10/auto_placement_annotations/

http://www.acrobatusers.com/tutorials/2007/js_add_buttons_to_pdf/

You can write a VB application that controls Acrobat and calls Acrobat JavaScipt functions. You'll find information about this here.

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

Click on the documentation tab and scroll down to "Interapplication Communication"

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