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

FunctionNotAllowed Error

jmkane
Registered: Jan 28 2010
Posts: 2

I'm trying to populate a PDF with data from an XML file. I wrote a folder level script to run it, but it stops at xfa.host.importXML("filename.xml") with the security error "Function not allowed error," I then tried to place the script in a button on the pdf itself and it gave the same error on the mouse down event. I have javascript enabled and I am under the impression that folder level scripts are run as privileged. What am I missing?

if (doc.documentFileName == "filename"){
xfa.host.importXML("filename.xml")
}

Any insight or another method to achieve the same goal would be appreciated.
I am using LiveCycle ES 8.2 and Adobe Pro 9

Jason

My Product Information:
Acrobat Pro 9.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
this function requires privilege. You'll need to place it in a trustedFunction.

Here's an article on the topic:
http://www.acrobatusers.com/tutorials/2008/10/using_trusted_functions

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script