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

How do we print both the original file name and directory path location for the source document in each pdf footer.

Gagner
Registered: Mar 5 2011
Posts: 5

How do we get the original file name (before conversion to pdf) and the original file directory location for the source document automatically printed in the footer of each pdf created. I am using Adobe Acrobat x Pro.
 
I need to be able to do this as a batch process to 1000s of files in all of the multiple layers of subdirectories of one root directory.
 
Is there a javascript that I can use that has been tested?
 
Thanks in advance!

Gagner

My Product Information:
Acrobat Pro 10.0, Windows
Merlin
Acrobat 9ExpertTeam
Registered: Mar 1 2006
Posts: 766
I guess that this should help you :
http://acrobatusers.com/content/file-name-stamper

;-)
Gagner
Registered: Mar 5 2011
Posts: 5
Thanks for your quick reply. I had looked at file name stamper (with much hope) but while this feature is designed to print the file name, it cannot print the original file path.

Thanks again.

Gagner

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
That action will crate a water mark and require usuries to have version 6 or better of Acrobat/Reader.

Besides a water mark, one could use the header/footer, a from field, a comment.

Obtaining the original file file name and original directory might not always be possible as Acrobat and Distiller does not capture this information at the time the PDF is created unless special user action is taken to add a special meta data field with this information. Acrobat/Distiller may capture the creating program name from some applications like MS Office or Adobe products. Other applications could provide this information if the vendors of these products include the necessary code to the source file or conversion routine.




George Kaiser

Gagner
Registered: Mar 5 2011
Posts: 5
Thanks for your reply. I am using Acrobat X Pro. Your comment about the difficulty in getting the original file and directory is insightful. In the batch processing, the closest I get to is having a temp name and a temp location printed in the footer area. The temp names of course are of no value. I am trying to have the original file name and location appear in the footer. Hopefully there is some javascript (or any other work around)that I can use.

Thanks again.


Gagner

UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
With batch processing in Adobe Acrobat there is no script access to the source file pathname - the Acrobat JavaScript engine is only activated in batch processes once the file has been converted to PDF, and by that time it's too late to make any note of the details.
Gagner
Registered: Mar 5 2011
Posts: 5
Thank you for explaining the limitations of using JavaScript with batch processing. Do you have any suggestion for a workaround using another approach that will allow me to print out thousands of documents (in multiple directories) and have a reference to the original filename and location in the footer?

Thanks for your help.

Gagner

gkaiseril
Online
Expert
Registered: Feb 23 2006
Posts: 4307
What is the format of the original files?

If they are MS Word, it is possible to add custom properties to the MS Word file that could be the path and name of the source file and original directory. One uses the special fields in MS Office to add a hidden print from field that inserts a printed line into the printed or converted file that consist of a a PDF Mark command to add the custom property.

If your application creates a PS file, you could add a step to insert the necessary PDF Mark commands into the PS file prior to Distilling the PS file to a PDF file or have your application insert the necessary PDF Mark commands.


Are the original files resulting PDF files in the same directory?

If you can identify the source type of file and the source file and related PDF are in the same directory, you could even use Acrobat JavaScirpt to create custom property fields.


Just be aware that this information could change over time as servers are replaced/renamed and file directories are moved.

George Kaiser

Gagner
Registered: Mar 5 2011
Posts: 5
Thank you George.

The original file are in various formats - many are CAD drawings. There are so many that it would not be possible to go into each and every one to make the change.

The need to be able to trace documents by their original filename and path is a common one for many. There must be a workaround (I hope) somewhere. Adobe engineers, any thoughts?

Gagner

try67
Expert
Registered: Oct 30 2008
Posts: 2398
Here's my 2 cents on the matter:
As George pointed out, the original file-name is not available to a script in a batch process.
However, if you're using the same file-names when converting to PDF, then the following might be possible:

- Output a list of all file-names that are about to be converted to a plain-text file. For example, this command will create a simple list of all file-names in a folder and save it as list.txt in the same folder:
dir /a-d /b > list.txt
Or even (if you want to filter out any pre-existing PDF files):
dir /a-d /b | find /v ".pdf" > list.txt
- Convert all files in that folder to PDF.
- Run a custom-made script that will read in list.txt and apply the original file name to the meta-data of the matching PDF file (of course, it won't work if you have two files with the same name and different file-types), and as a footer.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com