Skip to main content
This topic is closed to new replies. Start a new post to keep the conversation going.
Doug Hanna
Doug HannaCorrect answer
Inspiring
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;


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

4 replies

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.

Translate
Participant
September 26, 2016

Could you please make a example Script for printing test?

Thank you!

Translate
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;

Translate