This content has been marked as final. Show 38 replies
>Exception in line 2 of function top_level, script XFA:person:initialize
This is per the documentation. See the security notes in the
description of this method, the one with the red "Note" at the start.
I put this
myImportDataObject = app.trustedFunction(
var myDoc = event.target;
Exception in line 5 of function anonymous, script Folder-Level:User:myImportDataObject.js
Exception in line 1 of function top_level, script XFA:person.#subform.Name:docReady
NotAllowedError: Security settings prevent access to this property or method.
Do you use the method during a batch or console event, or through an external call?
I don't see any mention of trusted functions in the security notes.
I use the method at initialize event on the subform element
For security reasons, this property or method may be available only during certain events. These
events include batch processing, application start, or execution within the console. (See the
event object for details of the Acrobat events.)
Beginning with Acrobat 7.0, to execute a security-restricted method through a menu event, one of
checked. The method is executed through a trusted function. For details and examples, see the
As it says in the documentation:
> If the cDIPath parameter is specified, this method can only be executed during a batch or console event, or through an external call (for example, OLE).
This is for security reasons. Security is there for a reason. If you are supplying a path to the file to load, it needs to be executed from an external call (i.e. via the VB<->JS bridge). If you remove your path reference, it will open a dialog and allow the user to choose the file to embed. It will then work from a folder-level (or even document-level) script.
Read the documentation carefully.
1.I remove my path reference , at initialize event on subform element I put this script:
var myDoc = event.target;
but dialog doesn't appear.
2.Where I have to put my script if I want to be execute during batch or console event or external call ?
You should put it in docReady if it has to be in a start-up event. Test it on a button first to make sure it works the way you want.
> 2.Where I have to put my script if I want to be execute during batch or console event or external call ?
In all of those cases, the script is not embedded in the document.
Batch: In your batch setup.
Console: In the console.
External Call: In your external application.
I'm sorry if my question are stupid but I'm new to this environment :
1.Where to find my batch setup?
3.Where to read more about how to make external call?
1. Advanced > Document Processing > Batch Processing
3. Start with the Interapplication Communication (IAC) documentation that is included with the SDK. There are also IAC samples included in the SDK in various languages (C#, VB, C, HTML).
var myDoc = event.target;
myDoc.importDataObject("My data2"); When I put this on button it works fine (a dialog appears).
this.importDataObject("MyData", "/pathTo my xml file") and point option 'Run commands on' to my pdf form but nothing happens. Can you tell me what is the correct way to importDataObject in batch processing script ?
Did you specify a device-independent path?
Hi, can you send me an example of device independent path ?
My path look like this :
I change to this path but nothing happens again.
When I execute this
in the console I get the following error :
TypeError: this.importDataObject is not a function
Ok, that suggests that in the current context "this" is not the object
which has the importDataObject class. Read the description of the
"this" object, as it changes meaning, and in some cases is undefined.
/D/TestPDFFormAppl/pdf/person.xml is a device-independent path.
What happens when you only type this in the console?
ReferenceError: D is not defined
Only type following:
Did you open a document?
I only opened form in adobe designer.
I open document in adobe acrobat. Now everything works fine in the console I can import dataObject and after that to get it. But how to achieve the same in batch process?
1: to import dataObject in batch processing.
2: to get that dataObject on docReady event.
will work in a batch sequence.
in batch sequence .But after that when I try to get dataObject with
I get the following error:
TypeError: this.getDataObject is not a function
Is this the correct way to get this dataObject in document ?
Did 'this' point to a document in the LiveCycle Designer form?
My batch sequence is run only when I click button 'Run Sequence' but not when I open form. I point run commands on option to my pdf but nothing again. Do I miss something ?
> I point run commands on option to my pdf but nothing again.
I don't understand.
In adobe acrobat 7
advanced - batch processing - edit sequence - run commands on
To use a batch sequence you must press the button 'Run Sequence'.
Can batch sequence run when the pdf form is open ?
You can't use a batch sequence on a already opened document.
I mean when the form is open for the first time is it possible the batch sequence to be run.
You use the batch sequence to prepare all files in advance.
Is the button 'Run Sequence' the only way to run batch sequence ?