These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

NotAllowedError: Sicherheitseinstellungen verhindern den Zugriff auf diese Eigenschaft oder Methode.

mibu1mt
Registered: Mar 3 2011
Posts: 17
Answered

I want to save a form as xml by clicking a tool button.
I always get a security error (mentioned in subject above), althoug saveAs method is run as trustedFunction.
 
CODE: ************************************************************
var mySaveAs = app.trustedFunction(
function(Doc)
{
app.beginPriv();
Doc.saveAs('c:/test.xml','com.adobe.acrobat.xml-1-00');
app.endPriv();
});
  
// add a toolbutton "DCT_Backend"
app.addToolButton({
cName: "dct_tool_button2",
cExec: "mySaveAs(this);",
cTooltext: "XML-Export Formular",
cEnable: true,
cLabel: "DCT - Formular XML Export",
nPos: -1
});
******************************************************************
 
what am i doing wrong?
 

My Product Information:
Acrobat Pro 10.0, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Accepted Answer
Problem #1: You are not using a correct path syntax.
Problem #2: You are trying to save the file at the root folder, which is not a safe path.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

mibu1mt
Registered: Mar 3 2011
Posts: 17
First Problem solved, thanks very much.
Next Problem is the generated XML, where no dynamic form data is represented at all..

When is use the build-in 'export form data link' in acrobat, the generated xml is fine.
is there a way to fire this function from javascript?

Thanks