Skip to main content
Participant
November 2, 2017
Answered

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

  • November 2, 2017
  • 4 replies
  • 1538 views

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 has been closed for replies.
Correct answer Thom Parker

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"

4 replies

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
November 2, 2017

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
Participant
November 2, 2017

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

try67
Community Expert
Community Expert
November 2, 2017

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.

Inspiring
November 2, 2017

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?

Participant
November 2, 2017

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;

}

Karl Heinz  Kremer
Community Expert
Community Expert
November 2, 2017

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

Participant
November 2, 2017

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

Karl Heinz  Kremer
Community Expert
Community Expert
November 2, 2017

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.