Hello,
Is there any possibility to assign programmaticaly a text inside a popup note ?
The popup note is associeted to a custom stamp and called with "OpenPopup" command.
Thanks a lot.
Fill programmaticaly a popup note
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Fill programmaticaly a popup note
Hello spock,
You should be able to do that using JS code to populate the "contents" field of the annotation.
Please take a look at the RunJavaScript method in the Viewer's AX user manual for details on executing JS code.
Regards,
Stefan
You should be able to do that using JS code to populate the "contents" field of the annotation.
Please take a look at the RunJavaScript method in the Viewer's AX user manual for details on executing JS code.
Regards,
Stefan
-
- User
- Posts: 9
- Joined: Tue Jul 30, 2013 4:41 pm
Re: Fill programmaticaly a popup note
Hello Stefan,
Thank for your response.
I'm searching into the JavaScript for Acrobat API Reference, but I don't find how to proceed.
Can you give me a code example ?
Thanks,
Best regards,
Thank for your response.
I'm searching into the JavaScript for Acrobat API Reference, but I don't find how to proceed.
Can you give me a code example ?
Thanks,
Best regards,
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Fill programmaticaly a popup note
Hi spock,
The below is taken from the same manual file
and is creating a new annotation:But also illustrates how the "contents" property works.
Regards,
Stefan
The below is taken from the same manual file

Code: Select all
var annot = this.addAnnot({
page: 0,
type: "Text",
point: [400,500],
author: "A. C. Robat",
contents: "Call Smith to get help on this paragraph.",
noteIcon: "Help"
});
Regards,
Stefan
-
- User
- Posts: 9
- Joined: Tue Jul 30, 2013 4:41 pm
Re: Fill programmaticaly a popup note
Stefan,
Thank for your response, it's very useful when I create a new stamp.
But I also need to set the contents property for popup notes attached to existing stamps.
How to proceed in this case ?
Thanks,
Regards
Thank for your response, it's very useful when I create a new stamp.
But I also need to set the contents property for popup notes attached to existing stamps.
How to proceed in this case ?
Thanks,
Regards
-
- Site Admin
- Posts: 19913
- Joined: Mon Jan 12, 2009 8:07 am
Re: Fill programmaticaly a popup note
Hi Spock,
You will need something like the following: The above code will get all annotations on the first page of a document, will check which of those are stamps, and for them will add the "Your text here" as a pop-up text.
Regards,
Stefan
You will need something like the following:
Code: Select all
var annots = this.getAnnots({ nPage:0 });
for (var i = 0; i < annots.length; i++)
if (annots[i].type == "Stamp")
annots[i].contents = "Your text here";
Regards,
Stefan