Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorer ,
Jun 19, 2017 Jun 19, 2017

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?

TOPICS
Create PDFs
7.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Jun 19, 2017 Jun 19, 2017
LATEST

Like this, more or less:

var myDialog = {

     // dialog definitions go here

}

app.execDialog(myDialog);

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2017 Jun 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2017 Jun 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2017 Jun 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2017 Jun 19, 2017

That's what I figured I was going to have to do. I was just hoping to try and avoid it.

Maybe I can still tweak some things that will make it work. I have another PDF file where the warning window pops up that has a slightly tweaked title as as well as spaced paragraghs with instructions.

Java popup.PNG

What will I need to do in order to get a script like this to pop up in my document?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2017 Jun 19, 2017

You can specify the part of the title after the warning like this:

app.alert("Text", 3, 0, "Title")

To be able to use some different fonts and add a check-box like in the screenshot above you'll need to create a Dialog object, which is much more complex than an alert.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2017 Jun 19, 2017

Really? Like, how much more complex?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2017 Jun 19, 2017

Quite a bit... It's all documented under the execDialog method of the app object, if you're interested in digging into it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 19, 2017 Jun 19, 2017

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2017 Jun 19, 2017
LATEST

Like this, more or less:

var myDialog = {

     // dialog definitions go here

}

app.execDialog(myDialog);

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 19, 2017 Jun 19, 2017

To add a line break you need to include this escaped character in the string "\n". For example:

"This is the first line of text.\nThis is the second line of text."

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