Text frame with onClick Event (interactive PDF)

New Here ,
Nov 20, 2018

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript

Views

339

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Text frame with onClick Event (interactive PDF)

New Here ,
Nov 20, 2018

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript

Views

340

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 20, 2018 0
Most Valuable Participant ,
Nov 20, 2018

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 20, 2018 0
New Here ,
Nov 20, 2018

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 20, 2018 0
Most Valuable Participant ,
Nov 21, 2018

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 21, 2018 0
Guru ,
Nov 20, 2018

Copy link to clipboard

Copied

Moved to JavaScript

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 20, 2018 0
Guru ,
Nov 20, 2018

Copy link to clipboard

Copied

Ehm, maybe I should move it back?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 20, 2018 0
Most Valuable Participant ,
Nov 20, 2018

Copy link to clipboard

Copied

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...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 20, 2018 0