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

Inserting filenames in a PDF

vsavell
Registered: Apr 25 2011
Posts: 1

Is it possible to have Adobe insert the filename of a PDF as a header or footer without having to manually type it in each PDF?

V. Savell

My Product Information:
Acrobat Pro 9.4, Windows
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
You can do it (almost) with a script. There's no JS function to create header/footer entries per se, but you can create a scripted watermark, which in PDF terms is the same thing.

For example this script will put the filename (only) in the bottom center of every page:

this.addWatermarkFromText({
cText: this.documentFileName,
nTextAlign: app.constants.align.center,
nHorizAlign: app.constants.align.center,
nVertAlign: app.constants.align.bottom,
nFontSize: 12,
nVertValue: 12});


For details on all the parameters, see the Acrobat JavaScript documentation.
Dimitri
Expert
Registered: Nov 1 2005
Posts: 1389
Hi vsavell,

Yes, totally doable. There is an Action for automating that process in the Actions Exchange here at AUC. You can find it at-
http://acrobatusers.com/content/file-name-stamper

Hope this helps,

Dimitri
WindJack Solutions
www.pdfscripting.com
www.windjack.com