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

Nov 02, 2017

Copy link to clipboard

Copied

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

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"

TOPICS
Acrobat SDK and JavaScript, Windows

Views

283

Likes

Translate

Translate

Report

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

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

Nov 02, 2017

Copy link to clipboard

Copied

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

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"

TOPICS
Acrobat SDK and JavaScript, Windows

Views

284

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Nov 02, 2017 0
Nov 02, 2017

Copy link to clipboard

Copied

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%2FJ...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2017 0
Nov 02, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2017 0
Nov 02, 2017

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2017 0
Nov 02, 2017

Copy link to clipboard

Copied

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?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2017 0
Nov 02, 2017

Copy link to clipboard

Copied

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;

}

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2017 0
Nov 02, 2017

Copy link to clipboard

Copied

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2017 1
Nov 02, 2017

Copy link to clipboard

Copied

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"

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2017 0
Nov 02, 2017

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Nov 02, 2017 1