What do you mean, exactly?
Are you talking about the initialization of Acrobat when you double click on a PDF?
If so, you should test your version as I have seen some document level scripts fire before an application folder script. But I have not researched why this happens. If it is important for one script to fire before another, you can use flag variables or other coding checks to see if a script has run or created an object and if not then set a timer action and test for the existence again or provide some other action to test for the successful action later in your processing. I have used the 'type of' statement to test for a given user created application folder function, each time that function needs to be called.
I need this informations as a part for my article (whitepapper).
I look for how app, doc, page, field and annot3d (no matter they are objects or properties of one another) are correlate one with anoter (or its hierarchy)
var myDoc = app.openDoc("myNovel.pdf", this);
or Doc is property of App object?
2. Page is property of Doc object?
I has read it before. But I can't find there answer to my question
Please look at this picture:
Feld and Annotation (3D annotation is part of Annotation) is part of Doc object.
May be Doc and App is separate objects, but one can open documents using App objects.
What is True?
So to access to some type of annotation (link, 3d) we must
1. access to App for open some file
2. access to Doc (or this)
3. access to Page (current or PageNum)
4. access to link (create, delete)
You have to have Acrobat/Reader open to open a PDF and use some or all of the Acrobat JS features.
When Acrobat/Reader is started various folders are accessed and files within those folders read and processed to create the application. This includes dictionaries, certain global variables, various functions provided by Adobe, and user defined functions or variables. The Adobe provided functions or user provided functions or variables are accessed by their assigned name. So if you created an application folder level function in a file called 'hello.js' containing the following code:
Within an open PDF there are various actions. The first is the document level scripts that are used to establish the environment in which that PDF will function. This could include special functions to sum values, compute date differences, perform special key stroke and formatting. There can even be test to see if there are any necessary application level functions available for use the the document.
Within PDF document you can can fields, links, comments, etc. And these items only exist in the PDF document and rely on the PDF document for performing the various task or communicating those task the the application.
See Getting Started - Developing for PDF by Dave Wright and look around the Planet PDF site.
GKaiseril, thank you, but it is not direct answer to my question
I only need relation between App, Doc, Page, Link, Annot3D objects.
If you need create link, you have to open document using App, then get page using Doc, then creater or delete Link.
In terms of Hierarchy, it will be better to correlate the JS applied at various levels. Consider JS applied at App level , Doc level , Page level , Field level etc.
Hierarchy wise App level scripts will execute first, and then Doc > Page > Field.
As far as comparing the objects, hierarchy would hold good if the objects lower in hierarchy are derived from parent objects, which is not the case here. It is true that there are ways in which Doc object is returned using app.openDoc or app.activeDocs but there are other ways to access Doc object such as event.target and that does'nt mean that event.target is up in hierarchy to Doc.
It would help if you can share in what context / usecase you are writing this for. Perhaps, I misunderstood the question. This is to best of my knowledge.
My 2 cents.
But the exact order of execution upon initializing Acrobat/Reader will depend upon where exactly the script is located, the order in which folders and files within folders are loaded, the order of functions within a file, and the order in which Acrobat/Reader applies document level scripts and page open scripts.
I have seen different versions of Acrobat run the page open action before a document level function when one double clicks a PDF file icon.
Functions and objects also have a scope over which they are active, a document level function in one document is only available to that PDF and not another PDF. One can even override an application level script by creating a function with the same name within a PDF, an example of scope.. There is an exception that is caused by the 'global' object that one can use to create a memory resident object or automatically shared field that is available to any open PDF and then for the 'global' object there are the 'setPersistent' and 'subscribe' methods that modify the availability across sessions or files.
You can check the order by adding scripts to various locations and straiting Acrobat/Reader and opening a PDF.
Opening a PDF:
Document level script - in ASCII sorted order of scripts then by line
Open Page action - by oder in which added then by line N.B. Sometimes this will fire before documentlevel depending upon version.
Form fields - in form field calculation order. Calls start from form field, document, application for first occurrence of function.
That's true. Rightly explained.
I don't ask about difference of scripts thats located in folders or saved inside of PDF
As I said previously, it would help if you can share some background / context regarding your question pertaining to object hierarchy.
I don't know how explain this more exactly.
But I try in other way:
how we can access to objects
1. Doc object (example: app.openDoc)
2. Page object
3. Annotation object
5. 3d artwork (3d annotation).
I try to make graph that shows these objects (also App object) correlations.
What's wrong with the one you posted earlier?
its ok, but App object not present there.
Or it is no good to show how Doc and App objects are relating?
You can add app above doc, if you want.
> You can add app above doc, if you want.
I will if it's will be right
You also have the JS engine on the system that provides objects like Array, Date, Math, Function, etc.