Hi,
I'm trying to figure out automating inserting the filename of my pdf into my pdf file.
I found how to create a script to insert the filename in a form field using:
event.value = this.documentFileName.replace(/\.pdf$/g,"");
But it seems I have to open the file to get that form field to populate with the filename.
What I'd like to do is be able to have a pdf template file that contains the javascript rule.
Copy that pdf file.
Change the filename of that pdf file.
Batch process the file so that the javascript executes and the file is saved in another file format with the filename inserted into the form field.
I'm basically trying to create a 'header tag' file to use as an identifying file.
If I open the pdf, I can get the javascript to execute and insert the filename.
But I'm trying to figure out how to automate things so that simply changing the filename and then batch processing the file to save it as a postscript file gives me a .ps file with the filename inserted.
Hope that makes sense!
thanks.
If I reset the form and then set the value, it works just like I want it to.
this.resetForm("Header");
event.value = this.documentFileName.replace(/\.pdf$/g,"");
Thought I'd post this in case it helps someone down the road.
(Of course, replace Header on the reset line above with whatever your form field is named.)