Skip to main content
Participant
Nov 2, 2017 4:08 PM UTC
Answered

Thom Parker's PDF Stamps - "Security settings prevent access to this property or method"

Hello -

I've been successful in creating a custom Balloon stamp, using the guidelines from Thom Parker'as excellent book "All ABout PDF Stamps..".

However, when I move my stamp PDF to my user's PC, I get this error:

NotAllowedError: Security settings prevent access to this property or method.

Info.exhibit:8:App UserData2:Calculate

Again, it works on my PC.

I've been searching and working on this on and off for a few weeks, and I am not making progress. Do I need to go the "trusted function" route?

What am I missing?

Thanks very much in Advance,

Brian

This topic is closed to new replies. Start a new post to keep the conversation going.
Thom Parker
Thom ParkerCorrect answer
Community Expert
Nov 2, 2017 6:30 PM UTC

If you are using the stamp in Acrobat Reader, then saving stamp data into the document is a problem.  There are some possible replacements, but it all depends on your objective.

Is it important to save the data on a per document basis? or could it be saved globally? Does data need to persist across Acrobat sessions? You might want to re-read the Chapter 8 section "Data Storage and Persistence"

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often

9 replies

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
Nov 2, 2017 6:30 PM UTC

If you are using the stamp in Acrobat Reader, then saving stamp data into the document is a problem.  There are some possible replacements, but it all depends on your objective.

Is it important to save the data on a per document basis? or could it be saved globally? Does data need to persist across Acrobat sessions? You might want to re-read the Chapter 8 section "Data Storage and Persistence"

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participant
Nov 2, 2017 9:44 PM UTC

Ah Ha!!  That is my issue - I did not realize that this script was saving the input locally for potential re-use later (as in an auto-incrementing balloon number).  I should know better than to just copy code without thoroughly understanding it.

Try67, thanks for your insight, and Thom, thanks for the insight and your great book. I haven't gotten to Chapter 8 because I thought I didn't need to worry about more complicated programming. I guess I did, so I could create simpler programming...

Thanks to everyone who replied - this sure is a responsive and thoughtful community!

Brian

Translate
try67
Community Expert
Community Expert
Nov 2, 2017 4:34 PM UTC

If you're only interested in the stamp, and not in saving the user's input into the file's metadata, just remove that line from the code.

Translate
Inspiring
Nov 2, 2017 4:20 PM UTC

What is the version on of Acrobat/Reader on the user's PC?

If it is 7.0 or greater, then you you need to use the privileged context.

What is the script that is running in the stamp?

Translate
Participant
Nov 2, 2017 4:23 PM UTC

The script is:

var cAsk = "Enter Number" ;

var cTitle = "Balloon Number:  ";

if(event.source.forReal && (event.source.stampName == "#Balloon"))

{

  var cMsg = app.response(cAsk, cTitle);

  event.value = cMsg;

  event.source.source.info.exhibit = cMsg;

}

Translate
Karl Heinz  Kremer
Community Expert
Community Expert
Nov 2, 2017 4:16 PM UTC

Are you trying to use this stamp with the free Adobe Reader? If so, you cannot write to document properties (via the Info object). See here for more information: https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/index.html#t=Acro12_MasterBook%2FJS_API_AcroJS%2FDoc_properties.htm%23TOC_info1bc-21&rhtocid=_6_1_8_23_0_20

Translate
Participant
Nov 2, 2017 4:25 PM UTC

Yes, we're using the free Adobe Reader DC.  I'm beginning to see that things have changed a bit since the book was published...

Translate
Karl Heinz  Kremer
Community Expert
Community Expert
Nov 2, 2017 4:33 PM UTC

Actually, this is not a new restriction. It's been a while since I worked through the book, but I am pretty confident that Thom does talk about this restriction.

Translate