I have created a form in LC that when the user clicks a button, the form should export data into XML and save it with a filename from a form field data. The saving part works great. The XML export does not.
I keep getting this security error in Acrobat Pro 9:
NotAllowedError: Security settings prevent access to this property or method.
Doc.exportXFAData:12:XFA:form1[0]:#subform[0]:Button1[0]:mouseUp
I certified the document using Acrobat Pro 9
This still did not work.
Am I doing something wrong with certifying the doc or is my code off?
Here is it:
Folder Level:
var mySaveDoc = app.trustedFunction(function(doc) {
app.beginPriv();
var cPath = "/network_drive/folder1/folder2/" + "/" + " " + empname + ".xml";
var myPath = "/network_drive/folder1/folder2/" + "/" + " " + empname + ".pdf";
// saveAs and exportXFAData is the only privileged code that needs to be enclosed
// with beginPriv/endPriv
doc.saveAs(myPath);
doc.exportXFAData(cPath);
app.endPriv();
});
Button:
//empname = xfa.resolveNode("xfa.form.topmostSubform[0].Page1[0].GradID[0]").rawValue
empname = xfa.resolveNode("form1.#subform[0].GradName").rawValue
event.target.mySaveDoc(event.target);
Please help.
You need to send the PDF to a certifying service for certification, not apply application level certification. See the Acrobat JS API Reference for more information.
George Kaiser