|
| Add (name, pdf_object) |
| Add a new key name with a PDF object as its value. More...
|
|
| constructor (document, type) |
| Constructor, with parameters. More...
|
|
| GetCount () |
| Get the count of elements in current name tree. More...
|
|
| GetName (index) |
| Get a key name in the name tree, by index. More...
|
|
| GetObj (name) |
| Get the value (as PDF object) of a specified key name. More...
|
|
| GetType () |
| Get the type of current name tree. More...
|
|
| HasName (name) |
| Check if the specified key name exists in current name tree. More...
|
|
| IsEmpty () |
| Check whether current object is empty or not. More...
|
|
| RemoveAllObjs () |
| Remove all key names from current name tree, along with theirs value (as PDF object). More...
|
|
| RemoveObj (name) |
| Remove a key name from current name tree, along with its value (as PDF object). More...
|
|
| Rename (old_name, new_name) |
| Rename an existing key name to a new key name. More...
|
|
| SetObj (name, pdf_object) |
| Set the value (as PDF object) of a specified key name. More...
|
|
Name tree is a kind of common data structure in PDF. Name tree serves a similar purpose to PDF dictionary
- associating keys and values - but by different means: in the name tree, a key name is treated as an alias of its value object. That means, the value object can be referred to by the key name instead of by reference object.
Name tree has following characteristics:
-
key names in a name tree are ordered and each key name in the same name tree is unique;
-
values associated with the key names may be objects of any type, depending on the purpose of the name tree;
-
name tree can represent an arbitrarily large collection of key-value pairs, which can be looked up efficiently without requiring the entire data structure to be read from the PDF file.
Class FSDK.PDFNameTree is used to be associated with an existing name tree with specified type or create one. It offers functions to get key-value pairs in the name tree, and set/add/remove any key-value pair. Currently, class FSDK.PDFNameTree can be associated with following name trees defined in PDF document:
-
Destinations name tree (with type FSDK.PDFNameTree.e_Dests), which maps name strings to destinations. Values in this name tree should be a destination array (or a reference object to destination array).
-
JavaScript name tree (with type FSDK.PDFNameTree.e_JavaScript), which maps name strings to document-level JavaScript actions. Values in this name tree should be a javaScript action dictionary (or a reference object to javaScript action dictionary).
-
EmbeddedFiles name tree, with type FSDK.PDFNameTree.e_EmbeddedFiles, which maps name strings to file specifications for embedded file streams. Values in this name tree should be a file specification dictionary (or a reference object to file specification dictionary), which contains an embedded file stream.
-
Pages name tree, with type FSDK.PDFNameTree.e_Pages, which maps name strings to pages. Values in this name tree should be a reference object to a page dictionary.
-
Templates name tree, with type FSDK.PDFNameTree.e_Templates, which maps name strings to hidden pages. Values in this name tree should be a reference object to a hidden page dictionary. Please use function FSDK.PDFDoc.HidePageTemplate to hide pages.
For convenient use about embedded files (known as attachments as well) in a PDF document, please refer to class FSDK.Attachments.
- See also
- FSDK.Attachments