how to show file path in footer

I need the file path of a pdf document to show in the footer (bottom left), and to have it automatically update when reopened (the same as MS word 2010 quick parts). I have tried using javascript that people provided from other forums and nothing seems to work for me. Please provide a step by step guide. Thank you very much.


Marlon Singson


2 Answers

Voted Best Answer

Can you please show us the Javascript you've used.

In general, the process is like this:

  1. Add a text field using the form tools where you want your footer to be shown on the page (Tools>Forms>Edit...)
  2. Make the form field read-only on the field's properties dialog
  3. Add a custom calculation script to the field on the field's properties dialog

This last step can be as simple as the following one-liner:

event.value = this.path

Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com


By Karl Heinz Kremer   

You can certainly add the date, and if you want to, you can with (a lot more) JavaScript convert the device independent path to a Windows path. To add the date, just use these lines instead:

var thePath = this.path;
var theDate = util.printd("mm/dd/yyyy", new Date());
event.value = thePath + " " + theDate;

If you want to work on the windows path, take a look at this page, which explains what the device independent paths are and how they work:

https://acrobatusers.com/tutorials/file-paths-acrobat-javascript

Karl Heinz Kremer
PDF Acrobatics Without a Net
PDF Software Development, Training and More...
http://www.khkonsulting.com


Karl Heinz Kremer   


Please specify a reason: