Skip to main content
Participant
November 21, 2018
Question

Text frame with onClick Event (interactive PDF)

  • November 21, 2018
  • 2 replies
  • 1227 views

Good morning,

I have to create a "checklist" for our office and would like to add a text frame with a onClick event behaviour. My idea is that
after exporting as an interactive PDF file the user can click (or double-click, doesn't matter) on this specific frame and it should
auto-complete this field with date and the windows login name. Is this possible and if yes, how can I do this?

What I've got so far is this command
--> alert($.getenv("USERNAME"));
which returns the actual logged in user but I'm struggeling with the onClick event (javascript is not really my business)

Thank you in advance
Kind regards
Moritz

This topic has been closed for replies.

2 replies

Trevor:
Legend
November 21, 2018

Moved to JavaScript

Trevor:
Legend
November 21, 2018

Ehm, maybe I should move it back?

Legend
November 21, 2018

Seems like the right forum now.

Have you studied the Acrobat JavaScript documentation? You will not be able to do this based only on knowledge, no matter how deep, of browser JavaScript.  For example, JavaScript belongs to form fields, not text frames, and there is no onClick event...

Legend
November 21, 2018

Acrobat scripting is based on JavaScript but is totally different to the stuff you use in a web page, and the Acrobat security model prevents a script embedded in a document from reading any properties of the user identity object.

Participant
November 21, 2018

I could just read the date and time but not the username? Not what I need but better than nothing.

Can you (or someone else) demonstrate how to realise an onClick event on a text Frame?

and thank you for the heads up

Legend
November 21, 2018