Saturday, August 15, 2009

Adobe Tip: Add filename to footer

Quick tip:

I create and receive quite a few Adobe PDF files in the course of my work.

Most are “complete” documents with names/descriptions prominently placed in the header or as a “title” somewhere on the page.

However, more than a few times I have been sent documents that are pretty similar in content and style but don’t really have any other distinguishing features to help me tell them apart when printed out

I wanted a way to quickly add the file-name of the document to the footer.  Having a date would be useful as well.

I use Adobe Acrobat Professional v8.0 at work for (most of) my PDF processing.  I checked all the information and screens I could, but nowhere in the print/page setup or options could I find that feature.

I turned to the Adobe forums and found this thread.

Adobe Forums: Print File Name with pdf Document

LReinhardF (Reinhard Franke) responded that the solution must be “hand-made” via a Javascript routine that is added to the Adobe program’s javascript folder.

He posted the last version of his code at http://www.refob.de/downloads/Acrobat/SetRemoveFooter.js

Right-click on that link and save it to the appropriate folder. \program files\adobe\acrobat "X"\javascript

Restart Adobe and it will appear as a option pick under the File menu approximately above the Print section.

It was a fast and simple solution that now allows me to better manage the hard-copy PDF printouts I use.

Note: this doesn’t apply to Adobe Reader.

There are some additional tips and Javascripting tweaks on the first page of that forum post.  The second page also has some more tips and information on doing the same thing but with header-inserts.  I was happy with the original solution, but if you are looking for more, keep reading the forum thread onto the 2nd page.

Cheers!

Claus V.

2 comments:

Unknown said...

Dear Claus V.

i've tried your js, that's very useful for us.

but the file name and date size is too small, i am trying to modify the js, but my knowledge is very limited.

....

thank you.

you can contact with me by below email
wwwqqq101@gmail.com

Claus said...

@ Qiang -- You're welcome. Glad you liked the tip.

I'm not a javascripting guy but I would focus on the following item:

fd.textSize=#

Find all instances of that and change the # to a larger value.

That's also the tip offered by "ReinhardF" in the forum where this started at. He's the writer of the original script.

In his thread post 76. he makes the following statement:

"Codeline:
fp.textSize=6; fp.readonly = true;
replace with:
fp.textSize=6; fp.readonly = true;fp.textColor = color.green;

Maybe you set the fp.textSize=6 to 8 or 10, then you see the color better.

I didn't test if the box is width enough for that. "

As I am understanding it from the thread, the js code creates a formated box area where the remaining code then displays the "output". If you increase the font size it might not fit in the original "box" so you will have to tweak the box positioning as well to make room for the larger text filling it for it to display correctly.

Make sense?

I recommend dropping in at that forum thread and asking ReinhardF for advice. He seems very kind and really clever at supporting his work.

Cheers!

--Claus V.