add attachment - NotAllowedError
We have PDF form with digital signature.
The form is developed in LiveCycle designer. The form is dynamic.
One specific User wants to be able to add an attachment sometimes later after she signed the form.
She was able to do that before Adobe Pro XI was installed on her PC (I think she had Adobe Pro 8 before).
Now the standard "Add" icon in Attachments is grayed out.
It looks like there is a workaround to overwrite the enhanced restrictions implemented by Adobe by using JavaScript API “importDataObject”.
I implemented the solution recommended by Adobe experts (see the links in the end of this post).
But it doesn't work.
I am receiving an error "NotAllowedError: Security settings prevent access to this property or method".
1. According to the links - API “importDataObject” can be executed only by another API “app.trustedFunction”.
2. “importDataObject” can only be executed in Privileged context.
3. Privileged context is Folder Level.
What I did:
1. Created config.js in C:\Program Files (x86)\Adobe\Acrobat 11.0\Acrobat\Javascripts:
var importMyAttachment = app.trustedFunction(function(oDoc, sFile){
app.beginPriv();
var rtn = oDoc.importDataObject(sFile);
app.endPriv();
});
2. In LiveCycle designer created custom button "Add Attachment"
On click event created JS code:
var myDoc = event.target;
if(typeof(importMyAttachment) == "function"){
var sFile = "myLittleFile";
importMyAttachment(myDoc,sFile);
}else{
console.println("Missing Attach Fucntion");
}
3. Opened the form in Adobe pro XI.
- signed the form.
- clicked button my custom "Add Attachment".
- received error "NotAllowedError: Security settings prevent access to this property or method."
From JS debugger - I can clearly see that importDataObject is called by trusted function in folder level:

Here are the links I used for the workaround:
https://acrobatusers.com/tutorials/folder_level_scripts
https://acrobatusers.com/tutorials/using_trusted_functions
How to get thru error "NotAllowedError: Security settings prevent access to this property or method"?
Thanks.

