Skip to main content
frankema
Participant
Jul 3, 2017 12:14 PM UTC
Answered

Print Date in Header

Hi Folks,

Since I have to do a lot of "klicking Work" with Scanned PDF, I was wondering if there is a posibility to maximum Automation.

What I have to do with a scanned main document with appendices (in one document):

1. OCR

2. C&P a dynamic formular field out of a template named "Heute" (engl. "Today") -> Put this in Header on any page (I use the site spanning tool)

3. open JS Editor -> document action -> "on print" and typ in the code:

var f = this.getfield("Today"); f.value="Printdate:"+util.printd("dd.mm.yyyy",newDate());

-> This works fine

4. Safe and crypt it to "print only" rights

Ok here is my Point: .

For Point 1, 3 and 4 the "Action Assistent" (Aktionsassistent in ger.) works very well for me. So ist there a posibility to put in the formular field automatically, always on the same position? I can't find it in the options of the action Assistent.

OR: Kind of a JS Code to generate such a field?

Another Problem: If I try on Point 2, not to use the c&p field from the template but generate manually a new one with exactly the same conditions like the template, the code won't work. Why ?

Thanks for help!

This topic is closed to new replies. Start a new post to keep the conversation going.
try67
try67Correct answer
Community Expert
Jul 3, 2017 12:57 PM UTC

In the future, you'll be better off asking questions about JS in Acrobat here: JavaScript

And yes, you can add a field using the addField method of the Document object.
It's documented in the Acrobat JavaScript API Reference.

2 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
Jul 3, 2017 12:57 PM UTC

In the future, you'll be better off asking questions about JS in Acrobat here: JavaScript

And yes, you can add a field using the addField method of the Document object.
It's documented in the Acrobat JavaScript API Reference.

Translate
frankema
frankemaAuthor
Participant
Jul 4, 2017 8:46 AM UTC

Thanks for getting my point albeit my english was german influenced :-D. I mean "FORMS" not "Formulars" and the "Action Assistent" is the batch tool.

But thanks anyway. AddField seems to work in the way I want.

regards !

Translate