Skip to main content
Participant
September 26, 2016
Answered

How to auto print Filename at page tail?

  • September 26, 2016
  • 1 reply
  • 2056 views

How to auto print Filename at page tail?

Thank you!

Just likes when printing documents, the web site link address will be shown or not be shown at the bottom of the page.

https://forums.adobe.com/discussion/create.jspa?containerType=14&containerID=4700&question=true&subject=How%20to%20auto%…

This topic has been closed for replies.
Correct answer Doug Hanna

Create a text field called "FileName", set it as Hidden, but Printable and then go to Tools - JavaScript - Set Document Actions and as the Will Print event enter this code:

this.getField("FileName").value = this.documentFileName;


If you want to automate the entire process (so you don't have to manually add the text box each time) take a look at addField(); in the JS_API_Reference manual.

There example is how to add a navi button to each page, but is straight forward enough modify it to add a textbox field to the bottom of each page with Try67's code to pull in the file name.

Thanks

Doug

1 reply

try67
Community Expert
Community Expert
September 26, 2016

You can add a print-only text field that contains the file-name using a simple script.

Participant
September 26, 2016

Could you please make a example Script for printing test?

Thank you!

try67
Community Expert
Community Expert
September 26, 2016

Create a text field called "FileName", set it as Hidden, but Printable and then go to Tools - JavaScript - Set Document Actions and as the Will Print event enter this code:

this.getField("FileName").value = this.documentFileName;