Javascript in a PDF (accessed by Adobe Reader)

Whenever a PDF with a javascript-doc action set to execute on doc open, I would like a unique string to be added to the top of each page. Generating the string seems easy, but how would I tell the script to insert the generated string into the currently opened PDF?

And, would this work if the PDF was opened in Reader?

function uniqid()
    var newDate = new Date;
    return newDate.getTime();

Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Karl Heinz KremerCommented:
You would create a text field at the location where you want the string to be placed. The calculation script of that field would then fill in the correct value. This will work in Reader, but you cannot save the updated value  (unless the document has the extended reader rights assigned to it).

Have you worked with interactive PDFs before? If not, I can give you more information about how to set up the field.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.