Skip to main content
luisv20399914
Known Participant
June 19, 2017
Answered

Creating a "pop up comment" upon opening that can be closed to view document.

  • June 19, 2017
  • 1 reply
  • 7413 views

I'm almost done creating a unique PDF but in order to use it properly, I wanted to include some instructions to the viewer so they know how to access all of the inner workings of the document.

I created a comment text-box and filled it with all of the relative information. How can I ensure this comment is viewable upon opening the document and then the view can either hit an "okay" box or a "close" box in order to view the document proper?

This topic has been closed for replies.
Correct answer try67

Interesting...  how would I access the execDialog in Acrobat Pro?


Like this, more or less:

var myDialog = {

     // dialog definitions go here

}

app.execDialog(myDialog);

1 reply

try67
Community Expert
Community Expert
June 19, 2017

Using a comment is not really a good way of doing that. Instead, you can use a script that displays a modal alert window.

The code would be something like this:

app.alert("Enter your message to the user here.",3);

And you should place it under Tools - JavaScript - Document JavaScripts. Create a new item (call it "scripts", or something like that) and then paste the code into it. It will execute each time the file is opened.

luisv20399914
Known Participant
June 19, 2017

Thanks for the quick reply Try67!

I tried using the JavaScript window and I was a little dissuaded that the title stated "Warning" on the popup. I was hoping to change that to read "PDF instructions" but I wasn't sure where to do that exactly.

That and the fact that I'm not sure how to code line breaks/paragraphs means all of the text gets clumped together as a single brick instead of a nice and formatted message.

try67
Community Expert
Community Expert
June 19, 2017

You can't do that (EDIT: change the title of the window), I'm afraid.

Another option is to use a (read-only) text field and a button field to hide it (and itself). You then add a code to the location I described that sets both fields as visible... Then you will have much more control over how it looks like.