Copy link to clipboard
Copied
Hello!.
I need that when printing a pdf in pdf, automatically make the file name without the extension appear on all pages.
I am a draftsman and I do the exploded views of my company's machines. When we enter these exploded views into the production program, the program reprints the pdf to pdf and names it with the name of the production list, which the pdf file has been associated with. What I need is that, at the moment of creating this pdf, in a field of the document pages, as if it were one of the fields in the footer or the header, the name of the file would appear. We need this, so that each exploded view can be associated with a production list.
Thank you
Copy link to clipboard
Copied
You can place a readonly field on a page where you want and use this as that field custom calculation script to get document name without extension:
var str = this.documentFileName.split(".");
event.value = str[0];
Copy link to clipboard
Copied
If the file name contains a period in it that won't correctly. Use this instead:
event.value = this.documentFileName.replace(/\.pdf$/i, "");
Copy link to clipboard
Copied
You'll find a free file name stamper tool here:
https://acrobatusers.com/actions-exchange/
And a better paid for tool here:
https://www.pdfscripting.com/public/File-Name-Stamper-Action-Description.cfm