PDSEdit Layer
General
22 items
PDSAttrObj
5 items
Functions(4)
PDSAttrObjCreate
void PDSAttrObjCreate(IN PDDoc pdDoc, IN ASAtom owner, IN ASBool indirect, OUT PDSAttrObj *attrObj)Creates a new attribute object with the specified owner. This may raise various exceptions.
Parameters
pdDoc: IN PDDocThe document in which the attribute object is created.
owner: IN ASAtomThe owner of the new attribute object.
indirect: IN ASBoolIf true , it creates the attribute object as an indirect Cos object and sets the pdDoc parameter's PDDocNeedsSave flag (see PDDocFlags). If false , it creates the attribute object as a direct object.
attrObj: OUT PDSAttrObj *(Filled by the method) The newly created attribute object.
Returns
voidSee Also
PDSAttrObjCreateFromStream
void PDSAttrObjCreateFromStream(IN ASAtom owner, IN OUT CosObj cosStreamObj, OUT PDSAttrObj *attrObj)Creates an attribute object with the specified owner from the specified Cos stream.
Parameters
owner: IN ASAtomThe owner of the new attribute object.
cosStreamObj: IN OUT CosObjThe Cos stream containing the data with which to create the attribute. The dictionary of this stream is modified.
attrObj: OUT PDSAttrObj *(Filled by the method) A pointer to the newly created attribute object. This actually points to cosStreamObj . May be NULL .
Returns
voidSee Also
PDSAttrObjGetCosObj
CosObj PDSAttrObjGetCosObj(PDSAttrObj attrObj)Gets the Cos object corresponding to the specified attribute object. This method does not copy the object, but is instead the logical equivalent of a type cast.
Parameters
attrObj: PDSAttrObjThe attribute object whose Cos object is obtained.
Returns
The dictionary Cos object for the attribute object.
PDSAttrObjGetOwner
ASAtom PDSAttrObjGetOwner(IN PDSAttrObj element)Gets the value of the key (Owner) in the specified attribute object. This may throw various exceptions.
Parameters
element: IN PDSAttrObjThe attribute object whose owner is obtained.
Returns
The ASAtom for the owner's name.
See Also
Typedefs(1)
PDSAttrObj
typedef CosObj PDSAttrObjRepresents PDF logical structure attribute objects, which are dictionaries containing application-specific data that can be attached to PDSElement objects.
PDSClassMap
6 items
Functions(5)
PDSClassMapAddAttrObj
void PDSClassMapAddAttrObj(IN PDSClassMap classMap, IN ASAtom classAtom, IN PDSAttrObj attrObj)Adds the specified attribute object to the specified PDSClassMap for the given class name. If the attribute object is already present, it is not added a second time.
Parameters
classMap: IN PDSClassMapThe PDSClassMap to which the specified attribute object is added.
classAtom: IN ASAtomThe ASAtom representing the class name.
attrObj: IN PDSAttrObjThe attribute object to add to the class in classAtom .
Returns
voidPDSClassMapGetAttrObj
void PDSClassMapGetAttrObj(IN PDSClassMap classMap, IN ASAtom classAtom, IN ASInt32 index, OUT PDSAttrObj *attrObj)Gets the attribute object associated with the specified class name at an index in the class. If there is only one object and index is zero, that object is retrieved. This may throw various exceptions.
Parameters
classMap: IN PDSClassMapThe PDSClassMap.
classAtom: IN ASAtomThe ASAtom of a class name for which an associated attribute objects is found.
index: IN ASInt32The index of the desired attribute object in the class.
attrObj: OUT PDSAttrObj *(Filled by the method) The attribute object at index . Set it to CosNull if there is no attribute object at the specified location.
Returns
voidPDSClassMapGetNumAttrObjs
ASInt32 PDSClassMapGetNumAttrObjs(IN PDSClassMap classMap, IN ASAtom classAtom)Gets the number of attribute objects associated with a class name. This may throw various exceptions.
Parameters
classMap: IN PDSClassMapIN/OUT The PDSClassMap.
classAtom: IN ASAtomIN/OUT The ASAtom of a class name for which the number of associated attribute objects is found.
Returns
The number of attribute objects associated with the class in classAtom .
See Also
PDSClassMapRemoveAttrObj
void PDSClassMapRemoveAttrObj(IN PDSClassMap classMap, IN ASAtom classAtom, IN PDSAttrObj attrObj)Removes the specified attribute object from the specified PDSClassMap. If classAtom is ASAtomNull, it removes all occurrences of attrObj in the entire classMap .
Parameters
classMap: IN PDSClassMapThe PDSClassMap from which the specified attribute object is removed.
classAtom: IN ASAtomThe ASAtom of a class name for which the associated attribute object is found.
attrObj: IN PDSAttrObjThe attribute object to remove from classMap .
Returns
voidPDSClassMapRemoveClass
void PDSClassMapRemoveClass(IN PDSClassMap classMap, IN ASAtom classAtom)Removes the specified class from the specified PDSClassMap, if it exists. This may raise various exceptions.
Parameters
classMap: IN PDSClassMapIN/OUT The PDSClassMap from which a class is removed.
classAtom: IN ASAtomIN/OUT The ASAtom representing the class to remove from classMap .
Returns
voidSee Also
Typedefs(1)
PDSClassMap
typedef CosObj PDSClassMapAssociates class identifiers, which are names, with objects of type PDSAttrObj. Structural elements maintain a list of names identifying classes to which they belong. The associated attributes are thus shared by all structural elements belonging to a given class. There is one class map per document, associated with the PDSTreeRoot. The write functions in the PDSEdit API are not available in Adobe Reader.
PDSElement
68 items
Functions(64)
PDDocEnumPDSElementsWithUserProperties
ASBool PDDocEnumPDSElementsWithUserProperties(PDDoc doc, EnumElementsWithUserPropertiesProc proc, void *clientData)Enumerates the elements in the document's structure tree that have UserProperties attributes or classes, calling the supplied enumeration procedure for each such element found. The procedure returns true to continue enumeration, or false to halt enumeration.
Parameters
doc: PDDocThe PDDoc whose structure elements are to be enumerated.
proc: EnumElementsWithUserPropertiesProcThe procedure to call for each PDSElement found to have UserProperties.
clientData: void *Client-supplied data to be passed to the client callback.
Returns
true if the enumeration completes, false if the enumeration callback returns false .
PDDocHasUserProperties
Returns true if the document declares that it has structure elements that conform to the UserProperties attributes or class conventions. This is based on both the presence of StructTreeRoot, and a value of "true" for the UserProperties key in the document's MarkInfo dictionary.
Parameters
doc: PDDocThe PDDoc to be examined.
Returns
An ASBool indicating whether the document declares that it has structure elements with UserProperties attributes or classes.
PDSElementAddAttrObj
void PDSElementAddAttrObj(IN PDSElement element, IN PDSAttrObj attrObj)Associates the specified attribute object with an element at the element's current revision value. This may raise various exceptions.
Parameters
element: IN PDSElementThe element with which attrObj is associated.
attrObj: IN PDSAttrObjThe attribute object to associate with element .
Returns
voidPDSElementAddClass
void PDSElementAddClass(IN PDSElement element, IN ASAtom classAtom)Adds a class name to the element's list of classes to which it belongs at the element's current revision value.
This may raise various exceptions.
Parameters
element: IN PDSElementclassAtom: IN ASAtom
Returns
voidPDSElementClearID
void PDSElementClearID(IN PDSElement element)Removes an element's ID, if it exists.
Parameters
element: IN PDSElementThe element whose ID is removed.
Returns
voidSee Also
PDSElementCreate
void PDSElementCreate(IN PDDoc pdDoc, OUT PDSElement *element)Creates a new (but empty) PDSElement. This may raise various exceptions.
Parameters
pdDoc: IN PDDocThe PDDoc in which the PDSElement is created.
element: OUT PDSElement *(Filled by the method) The newly created PDSElement.
Returns
voidPDSElementEnumKidsWithUserProperties
ASBool PDSElementEnumKidsWithUserProperties(PDSElement elem, EnumElementsWithUserPropertiesProc proc, void *clientData)Enumerates PDSElement objects, beneath the supplied PDSElement, that have user properties attributes/classes. The elements in a structure tree that have user properties form a virtual tree themselves; this procedure enumerates the children of the given structure element in this virtual tree. In other words, this procedure enumerates all the descendents( d ) of the supplied structure element( e ) such that PDSElementFindAncestorWithUserProperties(d) would return ( e ). The enumeration continues as long as the callback returns true , and halts when the proc returns false or all virtual children have been enumerated.
Parameters
elem: PDSElementThe PDSElement below which to search for elements with user properties.
proc: EnumElementsWithUserPropertiesProcThe client-supplied callback to call for each element found.
clientData: void *Client-supplied data to be passed to the client callback.
Returns
true if the enumeration completes, false if the enumeration callback returns false .
PDSElementEnumUserPropertiesAsASText
ASBool PDSElementEnumUserPropertiesAsASText(PDSElement elem, PDSElementEnumUserPropertiesAsASTextProc proc, void *clientData, ASBool includeHidden)Enumerates the PDSElement object's user properties by traversing the list of attribute objects and class objects, calling the caller-supplied procedure for each entry in the properties array. The enumeration proc receives the property information as a pair of ASText objects, for the property name and the property value. The enumeration continues as long as the callback returns true , and halts when the proc returns false or all properties have been enumerated.
Parameters
elem: PDSElementThe PDSElement whose user properties will be enumerated.
proc: PDSElementEnumUserPropertiesAsASTextProcThe callback that is called for each user property item.
clientData: void *Client-supplied data to be passed to the client callback.
includeHidden: ASBoolA boolean value indicating whether the client wants to be given property items that are marked as hidden.
Returns
true if the enumeration completes, false if the enumeration callback returns false .
See Also
PDSElementEnumUserPropertiesAsCosObj
ASBool PDSElementEnumUserPropertiesAsCosObj(PDSElement elem, PDSElementEnumUserPropertiesAsCosObjProc proc, void *clientData, ASBool includeHidden)Enumerates the PDSElement object's user properties by traversing the list of attribute objects and class objects, calling the caller-supplied procedure for each entry in the properties array. The enumeration proc receives the property information as a Cos Dictionary. See the description of objects in the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 7.3, page 13. You can find this document on the web store of the International Standards Organization (ISO). The enumeration continues as long as the callback returns true , and halts when the proc returns false or all properties have been enumerated.
Parameters
elem: PDSElementThe PDSElement whose user properties will be enumerated.
proc: PDSElementEnumUserPropertiesAsCosObjProcThe callback that is called for each user property item.
clientData: void *Client-supplied data to be passed to the client callback.
includeHidden: ASBoolA boolean value indicating whether the client wants to be given property items that are marked as hidden.
Returns
true if the enumeration completes, false if the enumeration callback returns false .
See Also
PDSElementExportUserProperties
ASErrorCode PDSElementExportUserProperties(PDSElement userPropsElement, ASBool wholeSubtree, ASBool includeHidden, ASBool flattenClasses, PDUserPropertiesXMLLabels xmlLabels, ASStm output)Exports user properties of the specified PDSElement in XML.
Parameters
userPropsElement: PDSElementThe element whose user properties are to be exported in XML format.
wholeSubtree: ASBoolA boolean value indicating whether to export user properties of the whole structure tree which contains userPropsElement , or just the subtree which starts from userPropsElement .
includeHidden: ASBoolA boolean value indicating whether the client wants to be given property items that are marked as hidden.
flattenClasses: ASBoolA boolean value indicating whether to flatten the attribute classes for each structure element. If true , the user properties for that class will be listed as properties for that stucture element. If false , the class will be listed for that structure element, and a list of classes and their properties will be listed near the end of the XML.
xmlLabels: PDUserPropertiesXMLLabelsThe XML tag/label information for exporting user properties. These labels are output as is. There is no XML escaping done. It is the caller's responsibility to make sure they conform to the XML standard.
output: ASStmThe output stream to which user properties are written. The encoding of the characters is UTF-8.
Returns
An ASErrorCode to indicate the success of exporting user properties in XML format. If ASErrorCode is 0 , it indicates success in exporting user properties; non-zero value indicates otherwise.
See Also
PDSElementFindAncestorWithUserProperties
Starting at the supplied structure element, this procedure follows the chain of parents (see PDSElementGetParent()) until a structure element is found that has user properties. If no such element is found (for example, the chain ended at the structure tree root), CosNull is returned.
Parameters
elem: PDSElementThe PDSElement at which to start searching upwards through the tree.
Returns
The first ancestor of elem that contains UserProperties attributes or class information, or CosNull if none is found.
See Also
PDSElementGetActualText
ASInt32 PDSElementGetActualText(IN PDSElement element, IN ASUns8 *buffer)Gets the actual text associated with the specified PDSElement. It returns the number of bytes in the text, or 0 if the element has no actual text or has an empty string. To check for the existence of alternate text, check for a non-zero return value. To get the needed size of buffer , call this method with a NULL buffer. Due to implementation issues, make the buffer one byte larger than the required size. Code will not NULL -terminate the string correctly in the case of Unicode strings.
Parameters
element: IN PDSElementThe structural element whose actual text is sought.
buffer: IN ASUns8 *If not NULL , buffer contains the element's actual text. The string is NULL -terminated (but not correctly for Unicode). This is not a C-style string, so normal string handling functions may not work; the buffer may contain a Unicode string.
Returns
An ASInt32 representing the number of bytes in the text, or 0 if the element has no actual text.
See Also
PDSElementGetActualTextASText
void PDSElementGetActualTextASText(PDSElement element, ASText text)Gets the actual text associated with the specified PDSElement as an ASText object.
Parameters
element: PDSElementThe element whose actual text is sought.
text: ASText(Filled by the method) The text object containing the element's actual text. The client must pass a valid ASText object. The routine does not allocate it.
Returns
voidPDSElementGetAlt
ASInt32 PDSElementGetAlt(IN PDSElement element, IN ASUns8 *buffer)Gets the alternate text associated with an element. It can first be called with a NULL buffer to find the size, so that buffer can then be appropriately sized. The Alt text can be legally defined as an empty string. To differentiate between an Alt text string of zero length and no Alt text being defined, call PDSElementHasAlt() first. Due to implementation issues, make the buffer one byte larger than the required size. The code will not NULL -terminate the string correctly in the case of Unicode strings.
Parameters
element: IN PDSElementThe element whose alternate text is obtained.
buffer: IN ASUns8 *(Filled by the method) A buffer into which the alternate text is placed. It may be NULL , if the method is called only to find the length of the element's alternate text. If it is not NULL , buffer contains the element's actual text. The string is NULL -terminated (but not correctly for Unicode). This is not a C-style string, so normal string handling functions may not work; the buffer may contain a Unicode string.
Returns
The number of bytes in the element parameter's alternate text.
See Also
PDSElementGetAltASText
void PDSElementGetAltASText(PDSElement element, ASText text)Gets the alternate text associated with the specified PDSElement as an ASText object.
Parameters
element: PDSElementThe element whose alternate text is sought.
text: ASText(Filled by the method) The text object containing the element's alternate text. The client must pass a valid ASText object. The routine does not allocate it.
Returns
voidPDSElementGetAttrObj
ASInt32 PDSElementGetAttrObj(IN PDSElement element, IN ASInt32 index, OUT PDSAttrObj *attrObj)Gets the attribute object at a specified array index in the specified element. If there is only one attribute object (that is, there is no array of attributes), and index is zero, that attribute object is obtained.
Parameters
element: IN PDSElementIN/OUT The element whose attribute is obtained.
index: IN ASInt32IN/OUT The index of the attribute object to obtain.
attrObj: OUT PDSAttrObj *IN/OUT (Filled by the method) The attribute object at index .
Returns
The revision number of element at time of last association.
PDSElementGetClass
ASInt32 PDSElementGetClass(IN PDSElement element, IN ASInt32 index, OUT ASAtom *classAtom)Gets the class name at an array index in the specified element. If there is only one attribute object (that is, there is no array), and index is zero, that class name is obtained.
Parameters
element: IN PDSElementThe element whose class is obtained.
index: IN ASInt32The index of the class to obtain.
classAtom: OUT ASAtom *(Filled by the method) The ASAtom describing the class.
Returns
The revision number of element at the time of the last association.
PDSElementGetCosObj
CosObj PDSElementGetCosObj(PDSElement element)Gets the Cos object corresponding to the specified element object. This method does not copy the object, but is instead the logical equivalent of a type cast.
Parameters
element: PDSElementThe element object whose Cos object is obtained.
Returns
The dictionary Cos object for the element object.
PDSElementGetFirstPage
CosObj PDSElementGetFirstPage(IN PDSElement pdsElement, OUT ASAtom *firstKidType, OUT CosObj *firstCosObjKidOnAPage, OUT PDEContainer *firstMCKidOnAPage)Gets the Cos object for the page of the first kid of the element. This may throw various exceptions. The order in which the returned page is first is the order of kids, not the order of pages. That is, the first descendant with page content determines which page is returned.
Parameters
pdsElement: IN PDSElementIN/OUT The element whose kid's first page is found.
firstKidType: OUT ASAtom *IN/OUT (Filled by the method) A pointer to an ASAtom for the name that appears as the Type entry of the actual first kid of element . Possible values are the values that PDSElementGetKid() can return. Pass NULL to inhibit setting firstKidType .
firstCosObjKidOnAPage: OUT CosObj *IN/OUT (Filled by the method) The kid whose content determined that the page returned was the first page with content, if that kid is a CosObj. Pass NULL to inhibit setting firstCosObjKidOnAPage .
firstMCKidOnAPage: OUT PDEContainer *IN/OUT (Filled by the method) The kid whose content determined that the page returned was the first page with content, if that kid is marked content that is not a CosObj. Pass NULL to inhibit setting firstMCKidOnAPage .
Returns
The CosObj of the page found, CosObjNull if the element has no page content.
See Also
PDSElementGetID
ASInt32 PDSElementGetID(IN PDSElement pdsElement, OUT ASUns8 *idBuf)Gets the ID of an element, or CosObjNull if there is no ID set.
Parameters
pdsElement: IN PDSElementThe element whose ID is obtained.
idBuf: OUT ASUns8 *(Filled by the method) A pointer to the buffer containing the element's ID.
Returns
The number of bytes in the ID, or zero if the element has no ID.
PDSElementGetKid
ASAtom PDSElementGetKid(IN PDSElement element, IN ASInt32 index, OUT CosObj *cosObjKid, OUT void **pointerKid, OUT CosObj *cosPage)Gets the kid at an array index in the specified element.
A PDF structural element, unlike the structure tree root, can have several different kinds of children: marked content, another element, or an entire PDF object. The parameter in which the kid is placed depends on the type of kid. If the kid is a structural element or an object reference, PDSElementGetKid() places the result in cosObjKid; if the kid is page content, it is placed in pointerKid.
Any or all of cosObjKid, pointerKid, and cosPage can be NULL to get the kid's type without setting that parameter.
Parameters
element: IN PDSElementindex: IN ASInt32cosObjKid: OUT CosObj *pointerKid: OUT void **cosPage: OUT CosObj *(Filled by the method) A pointer to the CosObj of the page containing the kid. If cosPage is NULL , it is not filled in, but the type of the kid is returned regardless.
Returns
The ASAtom representing the kid's Type value: StructElem, MC, or OBJR. MCR is never returned.
PDSElementGetKidEx
ASAtom PDSElementGetKidEx(IN PDSElement element, IN ASInt32 index, OUT CosObj *cosObjKid, OUT ASInt32 *mcid, OUT void **pointerKid, OUT CosObj *cosPage)Functions identically to PDSElementGetKid(), but for children that are marked contents can return the mcid as well as or instead of the actual object. This method cannot access marked content inside a Form XObject.
Parameters
element: IN PDSElementThe PDSElement containing the kid that is retrieved.
index: IN ASInt32The index of the kid.
cosObjKid: OUT CosObj *(Filled in by method) The kid being accessed (depending on the kid's type) or NULL .
mcid: OUT ASInt32 *(Filled in by method) The kid's mcid or NULL .
pointerKid: OUT void **(Filled in by method) A pointer to the kid, or NULL .
cosPage: OUT CosObj *(Filled in by method) The CosObj of the page containing the kid, or NULL .
Returns
An ASAtom representing the Type value of the kid. See above.
PDSElementGetKidWithMCInfo
ASAtom PDSElementGetKidWithMCInfo(PDSElement element, ASInt32 index, CosObj *cosObjKid, PDSMCInfoP mcidInfo, void **pointerKid, CosObj *cosPage)Functions identically to PDSElementGetKidEx(), but returns additional information about marked content kids that are in streams other than the page content streams.
Parameters
element: PDSElementThe PDSElement containing the kid that is retrieved.
index: ASInt32The index of the kid.
cosObjKid: CosObj *(Filled in by method) The kid being accessed (depending on the kid's type), or NULL .
mcidInfo: PDSMCInfoP(Filled in by method) The kid's information object, or NULL .
pointerKid: void **(Filled in by method) A pointer to the kid, or NULL .
cosPage: CosObj *(Filled in by method) The CosObj of the page containing the kid, or NULL .
Returns
An ASAtom representing the Type value of the kid.
See Also
PDSElementGetLanguage
ASInt32 PDSElementGetLanguage(IN PDSElement element, IN ASUns8 *buffer)Gets the language associated with the specified PDSElement. It returns the number of bytes in the language string, or 0 if the element has no language or has an empty string. To check for the existence of expansion text, call PDSElementHasLanguage(). To get the needed buffer size, call this method with a NULL buffer. Due to implementation issues, make the buffer one byte larger than the required size. Code will not NULL -terminate the string correctly in the case of Unicode strings.
Parameters
element: IN PDSElementThe structural element whose expansion text is sought.
buffer: IN ASUns8 *(Filled by the method) A buffer containing the element's expansion text, or NULL . See PDSElementSetLanguage() for format and languages. If not NULL , buffer contains the element's expansion text. The string is NULL -terminated (but not correctly for Unicode). This is not a C-style string, so normal string handling functions may not work; the buffer may contain a Unicode string.
Returns
An ASInt32 representing the number of bytes in the language string.
PDSElementGetNumAttrObjs
ASInt32 PDSElementGetNumAttrObjs(IN PDSElement element)Gets the number of attribute objects directly attached to the specified element.
Parameters
element: IN PDSElementIN/OUT The element whose number of attributes is obtained.
Returns
The number of attribute objects directly attached to element .
See Also
PDSElementGetNumClasses
ASInt32 PDSElementGetNumClasses(IN PDSElement element)Gets the number of classes to which the specified element belongs.
Parameters
element: IN PDSElementThe element whose number of classes is obtained.
Returns
The number of classes to which element belongs.
See Also
PDSElementGetNumKids
ASInt32 PDSElementGetNumKids(IN PDSElement element)Gets the number of kids of the specified element.
Parameters
element: IN PDSElementIN/OUT The element whose number of kids is obtained.
Returns
The number of direct kids of element .
See Also
PDSElementGetParent
void PDSElementGetParent(IN PDSElement element, OUT PDSElement *parent, OUT ASBool *parentIsTreeRoot)Gets the immediate ancestor element of the specified element in the tree. If the element's parent is another element, parent is set to that parent and parentIsTreeRoot is set to false . If the element's parent is the structure tree root, parent is set to CosNull and parentIsTreeRoot is set to true . If parentIsTreeRoot is NULL , it is not set.
Parameters
element: IN PDSElementThe element whose parent is obtained.
parent: OUT PDSElement *(Filled by the method) The element's parent.
parentIsTreeRoot: OUT ASBool *(Filled by the method) The element's parent is the structure tree root.
Returns
voidPDSElementGetRevision
ASInt32 PDSElementGetRevision(IN PDSElement element)Gets the revision number of an element.
Parameters
element: IN PDSElementIN/OUT The element whose revision is obtained.
Returns
The revision number of element .
See Also
PDSElementGetStructTreeRoot
ASBool PDSElementGetStructTreeRoot(IN PDSElement element, OUT PDSTreeRoot *treeRoot)Gets the structure tree root of the document containing element.
Parameters
element: IN PDSElementThe element whose title is obtained.
treeRoot: OUT PDSTreeRoot *(Filled by the method) The structure tree root.
Returns
true if the document has a structure tree root, false otherwise. If there is a structure tree root, it sets treeRoot to be the structure tree root.
See Also
PDSElementGetTitle
ASInt32 PDSElementGetTitle(IN PDSElement element, OUT ASUns8 *buffer)Gets the title of the specified element, returning the number of bytes in the title.
It can first be called with a NULL buffer to find the title size, so that buffer can be appropriately sized as one greater than the title's length.
Parameters
element: IN PDSElementbuffer: OUT ASUns8 *
Returns
See Also
PDSElementGetTitleASText
void PDSElementGetTitleASText(PDSElement element, ASText title)Gets the title associated with the specified PDSElement as an ASText object.
Parameters
element: PDSElementThe element whose title is sought.
title: ASText(Filled by the method) The text object containing the title. The client must pass a valid ASText object. The routine does not allocate it.
Returns
voidPDSElementGetType
ASAtom PDSElementGetType(IN PDSElement element)Gets the element's structural element type. The type corresponds to the Subtype key in the structure element dictionary. PDSElementGetType() gets the value of the Subtype key (not the Type key) in the structure element dictionary. All PDSElement objects have a Type value of StructElem.
Parameters
element: IN PDSElementThe element whose structural element type is obtained.
Returns
The ASAtom representing element's type.
See Also
PDSElementHasActualText
ASBool PDSElementHasActualText(IN PDSElement element)Tests whether ActualText is defined for a given PDSElement.
Parameters
element: IN PDSElementThe PDSElement being tested.
Returns
true if text exists (including the empty string); false otherwise.
PDSElementHasAlt
ASBool PDSElementHasAlt(IN PDSElement element)Tests whether Alt text is defined for a given PDSElement.
Parameters
element: IN PDSElementThe PDSElement being tested.
Returns
true if text exists (including the empty string); false otherwise.
See Also
PDSElementHasLanguage
ASBool PDSElementHasLanguage(IN PDSElement element)Tests whether a language string is defined for a given PDSElement.
Parameters
element: IN PDSElementThe PDSElement being tested.
Returns
true if text exists (including the empty string); false otherwise.
PDSElementHasUserProperties
Returns true if the PDSElement has attribute objects or class objects with an owner of UserProperties.
Parameters
elem: PDSElementThe PDSElement to examine.
Returns
ASBool indicating that some attribute objects or class objects have an owner of UserProperties.
PDSElementIncrementRevision
void PDSElementIncrementRevision(IN PDSElement element)Increments an element's revision count by one. This may raise various exceptions.
Parameters
element: IN PDSElementThe element whose revision count is incremented.
Returns
voidPDSElementInsertKid
void PDSElementInsertKid(IN PDSElement element, IN PDSElement kid, IN ASInt32 insertAfter)Inserts the specified kid PDSElement object into the specified element after position insertAfter .
Parameters
element: IN PDSElementThe element in which the specified kid is inserted.
kid: IN PDSElementThe kid to insert.
insertAfter: IN ASInt32The position after which the kid is inserted. If element currently has no kids, insertAfter is ignored.
Returns
voidPDSElementInsertMCAsKid
void PDSElementInsertMCAsKid(IN PDSElement element, IN CosObj cosPage, IN PDSMC mc, IN ASInt32 insertAfter)Inserts a reference to the specified PDSMC (marked content) in the specified element after position insertAfter . This method automatically creates MCR objects if needed. This may raise various exceptions.
Parameters
element: IN PDSElementThe element in which the reference is inserted.
cosPage: IN CosObjThe CosObj for the page containing the reference to insert.
mc: IN PDSMCThe marked content to insert.
insertAfter: IN ASInt32The position after which the reference is inserted. If element currently has no kids, insertAfter is ignored.
Returns
voidPDSElementInsertMCAsKidEx
void PDSElementInsertMCAsKidEx(IN PDSElement element, IN CosObj cosPage, IN PDSMC mc, IN ASInt32 insertAfter, IN CosObj cosStream, IN CosObj streamOwner)Extends PDSElementInsertMCAsKid(), inserting content that is in a stream other than a page content stream. This function is the same as PDSElementInsertStmMCAsKid(). This may raise various exceptions.
Parameters
element: IN PDSElementThe element in which the reference is inserted.
cosPage: IN CosObjThe CosObj for the page containing the reference to insert.
mc: IN PDSMCThe marked content to insert.
insertAfter: IN ASInt32The position after which the reference is inserted. If element currently has no kids, insertAfter is ignored.
cosStream: IN CosObjThe stream containing the content given by mc .
streamOwner: IN CosObjA Cos object to record as the owner of the content. It can be CosNull if the owner is not important.
Returns
voidPDSElementInsertMCRefAsKid
ASBool PDSElementInsertMCRefAsKid(IN PDSElement element, IN PDSMCRef ref, IN ASInt32 insertAfter)Takes a marked content reference and places the content that it identifies in the structure as a child of the element. This may raise various exceptions. the content reference handle will be filled out automatically if PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent() is called. Otherwise, PDEContentSetPage() or PDEContentSetContainingStmAndOwner() must be called explicitly.
Parameters
element: IN PDSElementThe structure element with which to associate marked content.
ref: IN PDSMCRefThe marked content reference describing the content on the page. It must have had a valid MCID, and must have been completed by subsequent content stream processing calls.
insertAfter: IN ASInt32The position after which the marked content is inserted into the element's kids. If the element has no children, insertAfter is ignored.
Returns
See Also
PDSElementInsertOBJAsKid
void PDSElementInsertOBJAsKid(IN PDSElement element, IN CosObj cosPage, IN CosObj obj, IN ASInt32 insertAfter)Inserts a reference to the specified PDF object as a kid into the specified element.
This may raise various exceptions.
Parameters
element: IN PDSElementcosPage: IN CosObjobj: IN CosObjinsertAfter: IN ASInt32
Returns
voidSee Also
PDSElementInsertStmMCAsKid
void PDSElementInsertStmMCAsKid(PDSElement element, CosObj cosPage, CosObj containingStm, CosObj stmOwner, PDSMC mc, ASInt32 insertAfter)Inserts a marked content sequence from a non-page-content stream as a kid of the specified element. This may raise various exceptions.
Parameters
element: PDSElementThe element in which the reference is inserted.
cosPage: CosObjThe CosObj for the page containing the reference to insert.
containingStm: CosObjThe stream containing the content given by mc .
stmOwner: CosObjThe PDF object owning the stream given in cosStream (for example, the annotation to which an appearance stream belongs). It can be CosNull if the owner is not important.
mc: PDSMCThe marked content to insert.
insertAfter: ASInt32The position after which the reference is inserted. If element currently has no kids, insertAfter is ignored.
Returns
voidPDSElementRemoveAllAttrObjs
void PDSElementRemoveAllAttrObjs(IN PDSElement element)Removes all attribute objects directly associated with the specified element.
Parameters
element: IN PDSElementThe element whose attributes are removed.
Returns
voidSee Also
PDSElementRemoveAllClasses
void PDSElementRemoveAllClasses(IN PDSElement element)Removes all classes from the specified element.
Parameters
element: IN PDSElementIN/OUT The element whose classes are removed.
Returns
voidPDSElementRemoveAttrObj
void PDSElementRemoveAttrObj(IN PDSElement element, IN PDSAttrObj attrObj)Removes the specified attribute object from an element. If element does not have an attrObj attribute, this method does nothing. Calling PDSElementRemoveAttrObj() while iterating over the attribute objects of an element will change the relationship between the attribute object indices and attribute objects. Although it is possible to track this change in indices in a single loop, it is more straightforward to accumulate a list of attribute objects to remove during one pass over the attribute objects and to carry out the actual removals during a subsequent iteration over the accumulated list.
Parameters
element: IN PDSElementThe element whose attribute is removed.
attrObj: IN PDSAttrObjThe attribute object to remove.
Returns
voidPDSElementRemoveClass
void PDSElementRemoveClass(IN PDSElement element, IN ASAtom classAtom)Removes the specified class name from the element's list of classes to which it belongs. Calling PDSElementRemoveClass() while iterating over the classes of an element will change the relationship between class indices and classes. Although it is possible to track this change in indices in a single loop, it is more straightforward to accumulate a list of classes to remove during one pass over the classes and to carry out the actual removals during a subsequent iteration over the accumulated list.
Parameters
element: IN PDSElementThe element from which the specified class is removed.
classAtom: IN ASAtomThe ASAtom representing the class to remove.
Returns
voidPDSElementRemoveKid
void PDSElementRemoveKid(IN PDSElement element, IN CosObj kid)Removes the specified kid from an element. This may raise various exceptions. The approved method of removing OBJ kids is PDSElementRemoveKidOBJ().
Parameters
element: IN PDSElementThe element whose kid is removed.
kid: IN CosObjThe kid to remove.
Returns
voidPDSElementRemoveKidMC
void PDSElementRemoveKidMC(IN PDSElement element, IN CosObj cosPage, IN PDSMC mc)Removes the specified PDSMC (marked content) from an element's kids, if it has any. After calling this method, use PDPageSetPDEContent() to commit any changes that have been made to the page contents. This may raise various exceptions.
Parameters
element: IN PDSElementThe element whose reference is removed.
cosPage: IN CosObjThe CosObj for the page containing the reference to remove.
mc: IN PDSMCThe marked content to remove.
Returns
voidPDSElementRemoveKidOBJ
void PDSElementRemoveKidOBJ(IN PDSElement element, IN CosObj kid)Removes an OBJ from among the kids of a given element. It does nothing if the given OBJ is not a kid of the given element. This may raise various exceptions.
Parameters
element: IN PDSElementThe element whose kid is having an OBJ removed.
kid: IN CosObjThe kid whose OBJ is removed.
Returns
voidPDSElementReplaceKid
void PDSElementReplaceKid(IN PDSElement element, IN CosObj oldKid, IN CosObj newKid)Replaces the specified kid in the specified element. This may raise various exceptions. The approved method of replacing OBJ kids is PDSElementReplaceKidOBJ().
Parameters
element: IN PDSElementIN/OUT The element whose kid is replaced.
oldKid: IN CosObjIN/OUT The kid to replace.
newKid: IN CosObjIN/OUT The kid that is replacing oldKid .
Returns
voidPDSElementReplaceKidMC
void PDSElementReplaceKidMC(IN PDSElement element, IN CosObj oldCosPage, IN PDSMC oldMC, IN CosObj newCosPage, IN PDSMC newMC)Replaces the specified PDSMC (on oldCosPage ) with a new PDSMC (on newCosPage ) in the specified element. This may raise various exceptions.
Parameters
element: IN PDSElementThe element whose reference is replaced.
oldCosPage: IN CosObjThe CosObj for the page holding the reference to replace.
oldMC: IN PDSMCThe marked content to replace.
newCosPage: IN CosObjThe CosObj for the page holding the reference that is replacing oldMC .
newMC: IN PDSMCThe marked content that is replacing oldMC .
Returns
voidPDSElementReplaceKidOBJ
void PDSElementReplaceKidOBJ(IN PDSElement element, IN CosObj oldObj, IN CosObj newObj, IN CosObj newPage)Replaces oldObj with newObj on the specified page in the specified element. This may raise various exceptions.
Parameters
element: IN PDSElementIN/OUT The element whose object is replaced.
oldObj: IN CosObjIN/OUT The object to replace.
newObj: IN CosObjIN/OUT The object that is replacing oldObj .
newPage: IN CosObjIN/OUT The CosObj for the page holding the reference that is replacing oldObj .
Returns
voidPDSElementSetActualText
void PDSElementSetActualText(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes)Sets the actual text representation of the specified PDSElement object's contents to buffer (from 0 to nBytes ).
Parameters
element: IN PDSElementThe PDSElement whose contents are being set to buffer .
buffer: IN const ASUns8 *The buffer to which the PDSElement object's contents are being set.
nBytes: IN ASInt32The number of bytes in the text representation.
Returns
voidSee Also
PDSElementSetActualTextASText
void PDSElementSetActualTextASText(PDSElement element, const ASText text)Sets an element's actual text.
Parameters
element: PDSElementThe element whose content is being set.
text: const ASTextThe text object containing the string to be made the element's actual text.
Returns
voidPDSElementSetAlt
void PDSElementSetAlt(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes)Sets the alternate text representation of an element's contents.
Parameters
element: IN PDSElementIN/OUT The element whose alternate text representation is set.
buffer: IN const ASUns8 *IN/OUT A pointer to a buffer containing a string to be made the element's alternate text representation.
nBytes: IN ASInt32IN/OUT The number of bytes in buffer to use as the element parameter's new alternate text representation. It may be zero. It sets an Alt string even if the buffer length is zero, but such an Alt string looks like no Alt string according to PDSElementGetAlt().
Returns
voidSee Also
PDSElementSetAltASText
void PDSElementSetAltASText(PDSElement element, const ASText text)Sets the alternate text representation of an element's contents (ASText version of PDSElementSetAlt).
Parameters
element: PDSElementThe element whose alternate text representation is being set.
text: const ASTextThe text object containing the string to be set as the element's alternate text representation.
Returns
voidPDSElementSetID
void PDSElementSetID(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes)Sets the ID of an element to the given Cos string.
Parameters
element: IN PDSElementThe element whose ID is set.
buffer: IN const ASUns8 *A pointer to a buffer containing a string to be made the element's ID.
nBytes: IN ASInt32The number of bytes in buffer to use as the element parameter's new ID. It may be zero. It sets an ID even if the buffer length is zero, but such an ID looks like no ID according to PDSElementGetID().
Returns
voidSee Also
PDSElementSetLanguage
void PDSElementSetLanguage(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes)Sets the language field associated with the PDSElement to the buffer parameter's contents (from 0 to nBytes). IANA registered language codes can be found at http://www.isi.edu . The IETF Standard for Language Element Values (RFC 1766) can be found at http://www.ietf.org/rfc/rfc1766.txt?number=1766 .
Parameters
element: IN PDSElementThe PDSElement whose language field is set to buffer .
buffer: IN const ASUns8 *A pointer to a buffer containing a string to be made the element's language field. The empty string indicates that the language is unknown. The string should be in the format <IETF RFC-1766-language-code> . Note that the ISO 639 language codes can be found at http://lcweb.loc.gov/standards/iso639-2 .
nBytes: IN ASInt32The size of buffer . It may be zero. It sets the language even if the buffer length is zero, but such a language setting looks like no language according to PDSElementGetLanguage.
Returns
voidPDSElementSetTitle
void PDSElementSetTitle(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes)Sets an element's title.
Parameters
element: IN PDSElementbuffer: IN const ASUns8 *nBytes: IN ASInt32
Returns
voidSee Also
PDSElementSetTitleASText
void PDSElementSetTitleASText(PDSElement element, const ASText title)Sets an element's title.
Parameters
element: PDSElementThe element whose title is being set.
title: const ASTextThe text object containing the string to be made the element's title.
Returns
voidPDSElementSetType
void PDSElementSetType(IN PDSElement element, IN ASAtom type)Sets an element's type value to the specified type. The type corresponds to the Subtype key in the structure element dictionary. PDSElementSetType() sets the value of the Subtype key, not the Type key, in the structure element dictionary. All PDSElement objects have a Type value of StructElem.
Parameters
element: IN PDSElementThe element whose type is set.
type: IN ASAtomThe ASAtom representing the element's type.
Returns
voidSee Also
PDSOBJGetParent
void PDSOBJGetParent(IN CosObj obj, OUT PDSElement *parent)Gets the parent element of the specified PDF object. This may throw various exceptions.
Parameters
obj: IN CosObjIN/OUT The PDF object whose parent element is obtained. It must be referred to via an OBJR from some element (that is, it has a struct parent key), otherwise it is undefined.
parent: OUT PDSElement *IN/OUT (Filled by the method) The parent element of obj .
Returns
voidSee Also
Typedefs(4)
PDSElement
typedef CosObj PDSElementRepresents PDF structural elements, which are nodes in a tree giving a PDF document's logical structure.
EnumElementsWithUserPropertiesProc
typedef ASBool(* EnumElementsWithUserPropertiesProc) (PDSElement elem, PDSElement closestAncestorWithUserProperties, void *clientData))(PDSElement elem, PDSElement closestAncestorWithUserProperties, void *clientData)A callback for PDDocEnumPDSElementsWithUserProperties() and PDSElementEnumKidsWithUserProperties().
PDSElementEnumUserPropertiesAsASTextProc
typedef ASBool(* PDSElementEnumUserPropertiesAsASTextProc) (ASText propName, ASText propVal, void *clientData))(ASText propName, ASText propVal, void *clientData)Callback for PDSElementEnumUserPropertiesAsASText().
PDSElementEnumUserPropertiesAsCosObjProc
typedef ASBool(* PDSElementEnumUserPropertiesAsCosObjProc) (CosObj propDict, void *clientData))(CosObj propDict, void *clientData)A callback for PDSElementEnumUserPropertiesAsCosObj().
PDSMC
9 items
Functions(6)
PDSMCGetInfo
void PDSMCGetInfo(CosObj containingObj, PDSMC mc, PDSMCInfoP info)Gets information about how the specified marked content is contained in its parent. This method cannot access marked content inside a Form XObject.
Parameters
containingObj: CosObjThe CosObj containing the MC whose information is obtained. For marked content on a page, this is the Cos object representing the page. For marked content elsewhere, this is the stream in which the marked content resides.
mc: PDSMCThe marked content whose information is obtained.
info: PDSMCInfoP(Filled by the method) A pointer to a structure that the method fills with information about containingObj .
Returns
voidPDSMCGetPDEContainer
Gets the PDE container object for the specified marked content.
Parameters
mc: PDSMCThe marked content whose container is obtained.
Returns
The PDE container object.
PDSMCGetParent
void PDSMCGetParent(IN CosObj containingObj, IN PDSMC mc, OUT PDSElement *parent)Gets the parent element of the specified marked content.
Parameters
containingObj: IN CosObjThe CosObj containing the MC whose parent is obtained. For marked content on a page, this is the Cos object representing the page. For marked content elsewhere, this is the stream in which the marked content resides.
mc: IN PDSMCThe marked content whose parent is obtained.
parent: OUT PDSElement *(Filled by the method) The parent element of containingObj .
Returns
voidPDSMCIDGetParent
ASBool PDSMCIDGetParent(ASInt32 mcid, CosObj containingObj, PDSElement *parent)Gets the parent element of the specified marked content, referred to by its containing object and marked-content identifier.
Parameters
mcid: ASInt32The identifier (MCID) of the marked content whose parent is obtained.
containingObj: CosObjThe CosObj containing the marked content whose parent is obtained. For marked content on a page, this is the Cos object representing the page. For marked content elsewhere, this is the stream in which the marked content resides.
parent: PDSElement *(Filled by the method) The parent element of containingObj .
Returns
true if the parent is successfully obtained, false otherwise.
See Also
PDSMCRefCreate
PDSMCRef PDSMCRefCreate(IN PDEElement container, IN CosDoc cosDoc, IN ASInt32 mcid)Creates a reference handle to a piece of marked content that can be used to associate the content with structure. The handle can persist beyond the lifetime of the marked contents, allowing greater flexibility about when structure information can be created. This may raise various exceptions. This must be called before placing the container within the content stream that owns it. The handle will persist until PDSMCRefDestroy is called. All values in the PDSMCInfo object apart from mcid are currently ignored.
Parameters
container: IN PDEElementThe marked content to create a reference for. It must be either a PDEContainer or PDEBeginContainer.
cosDoc: IN CosDocThe document within which the reference will be used.
mcid: IN ASInt32The mcid to set for the container.
Returns
PDSMCRefDestroy
void PDSMCRefDestroy(IN PDSMCRef ref)Destroys a marked content reference created with PDSMCRefCreate(). This should only be called once the reference has been placed in the structure tree or if the reference is no longer needed. If the PDSMCRef is associated with a PDSMC, it will be set as invalid and ignored on subsequent processing.
Parameters
ref: IN PDSMCRefThe marked content reference to destroy.
Returns
voidTypedefs(2)
PDSMC
typedef PDEContainer PDSMCRepresents marked content, which are portions of the graphic content of a PDF document that may be included in the document's logical structure hierarchy. This type is identical with the PDFEdit layer type PDEContainer. The write functions in the PDSEdit API are not available in Adobe Reader.
PDSRoleMap
7 items
Functions(6)
PDSRoleMapCopy
void PDSRoleMapCopy(IN PDSRoleMap srcRoleMap, IN PDSTreeRoot dstTreeRoot, OUT PDSRoleMap *dstRoleMap)Makes a copy of a PDSRoleMap, making it the PDSRoleMap of the specified StructTreeRoot. This may raise various exceptions.
Parameters
srcRoleMap: IN PDSRoleMapThe PDSRoleMap to copy.
dstTreeRoot: IN PDSTreeRootThe structure tree root in which to place srcRoleMap.
dstRoleMap: OUT PDSRoleMap *(Filled by the method) If not NULL , it points to the new, copied PDSRoleMap.
Returns
voidSee Also
PDSRoleMapDoesMap
ASBool PDSRoleMapDoesMap(IN PDSRoleMap roleMap, IN ASAtom src, IN ASAtom dst)Determines whether the specified PDSRoleMap provides any mapping path for two given element types.
Parameters
roleMap: IN PDSRoleMapIN/OUT The PDSRoleMap.
src: IN ASAtomIN/OUT The ASAtom for an element type whose mapping is tested.
dst: IN ASAtomIN/OUT The ASAtom for an element type. Note that this may be a standard element type.
Returns
true if an mapping path was found, false otherwise.
See Also
PDSRoleMapGetDirectMap
ASAtom PDSRoleMapGetDirectMap(IN PDSRoleMap roleMap, IN ASAtom type)Gets the type, if any, directly mapped in the specified PDSRoleMap for the given element type.
Parameters
roleMap: IN PDSRoleMapThe PDSRoleMap.
type: IN ASAtomThe ASAtom for an element type whose mapping is found.
Returns
The ASAtom for the equivalent type specified in roleMap , or ASAtomNull if type has no mapping in roleMap .
See Also
PDSRoleMapMap
void PDSRoleMapMap(IN PDSRoleMap roleMap, IN ASAtom src, IN ASAtom dst)Maps an element type ( src ) to another element type ( dst ) in the specified PDSRoleMap.
Parameters
roleMap: IN PDSRoleMapThe PDSRoleMap in which to create a new mapping.
src: IN ASAtomThe element type to map to dst .
dst: IN ASAtomThe element type that src maps onto. Note that this may be a standard element type, such as P.
Returns
voidSee Also
PDSRoleMapUnMapDst
void PDSRoleMapUnMapDst(IN PDSRoleMap roleMap, IN ASAtom dst)Makes the specified element type have no mapping.
Parameters
roleMap: IN PDSRoleMapThe PDSRoleMap in which to un-map all element types that map onto the dst element type.
dst: IN ASAtomThe element type to which all mappings are removed. All element types that map to the dst element type are unmapped.
Returns
voidSee Also
PDSRoleMapUnMapSrc
void PDSRoleMapUnMapSrc(IN PDSRoleMap roleMap, IN ASAtom src, IN ASBool fixupOthers)Makes the specified element type have no mapping. This may raise various exceptions.
Parameters
roleMap: IN PDSRoleMapIN/OUT The PDSRoleMap in which to un-map the src element type.
src: IN ASAtomIN/OUT The element type whose mapping is removed.
fixupOthers: IN ASBoolIN/OUT If true , any element type that was directly mapped to src is mapped to whatever src previously mapped to. If false , PDSRoleMapUnMapSrc() only un-maps src .
Returns
voidSee Also
Typedefs(1)
PDSRoleMap
typedef CosObj PDSRoleMapRepresents mappings of structural element types present in a PDF document to standard element types having similar uses. There is one PDSClassMap per document, associated with the PDSTreeRoot. The write functions in the PDSEdit API are not available in Adobe Reader.
PDSTreeRoot
17 items
Functions(16)
PDDocCreateStructTreeRoot
void PDDocCreateStructTreeRoot(IN PDDoc pdDoc, OUT PDSTreeRoot *treeRoot)Creates a new StructTreeRoot element. If PDDocCreateStructTreeRoot() is called on a PDDoc that already has a structure tree root, it returns without modifying the document. It raises an exception if pdDoc already has a StructTreeRoot.
Parameters
pdDoc: IN PDDocIN/OUT The PDDoc for which the StructTreeRoot element is created.
treeRoot: OUT PDSTreeRoot *IN/OUT (Filled by the method) The newly-created StructTreeRoot element.
Returns
voidPDDocGetStructTreeRoot
ASBool PDDocGetStructTreeRoot(IN PDDoc pdDoc, OUT PDSTreeRoot *treeRoot)Gets the structure tree root for a document.
Parameters
pdDoc: IN PDDocThe PDDoc whose root is obtained.
treeRoot: OUT PDSTreeRoot *(Filled by the method) The structure tree root.
Returns
true if structure tree root found, false otherwise.
PDDocRemoveStructTreeRoot
void PDDocRemoveStructTreeRoot(IN PDDoc pdDoc)Removes, but does not destroy, the specified StructTreeRoot element from the specified PDDoc.
Parameters
pdDoc: IN PDDocIN/OUT The PDDoc for which the StructTreeRoot element is removed.
Returns
voidPDSTreeRootCreateClassMap
void PDSTreeRootCreateClassMap(IN PDSTreeRoot treeRoot, OUT PDSClassMap *classMap)Creates a PDSClassMap in the specified tree root. Any previously existing PDSClassMap is unlinked. This may raise various exceptions.
Parameters
treeRoot: IN PDSTreeRootThe structure tree root in which to create a PDSClassMap.
classMap: OUT PDSClassMap *(Filled by the method) The newly created PDSClassMap.
Returns
voidPDSTreeRootCreateRoleMap
void PDSTreeRootCreateRoleMap(IN PDSTreeRoot treeRoot, OUT PDSRoleMap *roleMap)Creates and sets the PDSRoleMap of the specified StructTreeRoot element. Any previously existing PDSRoleMap is unlinked. This may raise various exceptions.
Parameters
treeRoot: IN PDSTreeRootThe structure tree root in which to create a PDSRoleMap.
roleMap: OUT PDSRoleMap *(Filled by the method) The newly created PDSRoleMap.
Returns
voidPDSTreeRootGetClassMap
ASBool PDSTreeRootGetClassMap(IN PDSTreeRoot treeRoot, OUT PDSClassMap *classMap)Gets the PDSClassMap object for the specified structure tree root. This may throw various exceptions.
Parameters
treeRoot: IN PDSTreeRootThe structure tree root whose PDSClassMap is obtained.
classMap: OUT PDSClassMap *(Filled by the method) A pointer to a location in which to return the class map, if one exists. Set it to CosNull if there is no class map. If a NULL pointer is passed, no retrieval will take place.
Returns
true if there is a class map, false otherwise.
See Also
PDSTreeRootGetElementFromID
ASBool PDSTreeRootGetElementFromID(IN PDSTreeRoot treeRoot, IN const char *id, IN ASInt32 numChars, OUT PDSElement *element)Gets the element associated with the given ID, if any.
Parameters
treeRoot: IN PDSTreeRootid: IN const char *numChars: IN ASInt32element: OUT PDSElement *
Returns
See Also
PDSTreeRootGetKid
void PDSTreeRootGetKid(IN PDSTreeRoot treeRoot, IN ASInt32 index, OUT PDSElement *kid)Gets the kid at an array index in the specified structure tree root.
Parameters
treeRoot: IN PDSTreeRootThe structure tree root whose kid is obtained.
index: IN ASInt32The index of the kid to obtain.
kid: OUT PDSElement *(Filled by the method) A pointer to the kid at index .
Returns
voidSee Also
PDSTreeRootGetNumKids
ASInt32 PDSTreeRootGetNumKids(IN PDSTreeRoot treeRoot)Gets the number of kids of the structure tree root. This may throw various exceptions.
Parameters
treeRoot: IN PDSTreeRootIN/OUT The structure tree root whose number of kids is obtained.
Returns
The number of kids of the structure tree root.
See Also
PDSTreeRootGetRoleMap
ASBool PDSTreeRootGetRoleMap(IN PDSTreeRoot treeRoot, OUT PDSRoleMap *roleMap)Gets the PDSRoleMap object for the specified structure tree root. This may throw various exceptions.
Parameters
treeRoot: IN PDSTreeRootThe structure tree root whose PDSRoleMap is obtained.
roleMap: OUT PDSRoleMap *(Filled by the method) A pointer to a location in which to return the role map, if one exists. Set it to CosNull if there is no role map. If a NULL pointer is passed, no retrieval will take place.
Returns
true if there is a role map, false otherwise.
See Also
PDSTreeRootInsertKid
void PDSTreeRootInsertKid(IN PDSTreeRoot treeRoot, IN PDSElement kid, IN ASInt32 insertAfter)Inserts the specified kid element after the given position as a kid of the specified structure tree root. This may raise various exceptions.
Parameters
treeRoot: IN PDSTreeRootIN/OUT The structure tree root in which a kid is inserted.
kid: IN PDSElementIN/OUT The kid to insert.
insertAfter: IN ASInt32IN/OUT The position after which the kid is inserted. If element currently has no kids, insertAfter is ignored.
Returns
voidPDSTreeRootRemoveClassMap
void PDSTreeRootRemoveClassMap(IN PDSTreeRoot treeRoot)Removes the PDSClassMap of the specified structure tree root element. It does nothing if one does not exist. This may raise various exceptions.
Parameters
treeRoot: IN PDSTreeRootThe structure tree root whose PDSClassMap is removed.
Returns
voidSee Also
PDSTreeRootRemoveKid
void PDSTreeRootRemoveKid(IN PDSTreeRoot treeRoot, IN PDSElement kid)Removes the specified kid element from the specified structure tree root. This may raise various exceptions.
Parameters
treeRoot: IN PDSTreeRootIN/OUT The structure tree root whose kid is removed.
kid: IN PDSElementIN/OUT The kid to remove.
Returns
voidPDSTreeRootRemoveRoleMap
void PDSTreeRootRemoveRoleMap(IN PDSTreeRoot treeRoot)Removes the PDSRoleMap of the specified structure tree root element. It does nothing if one does not exist. This may raise various exceptions.
Parameters
treeRoot: IN PDSTreeRootThe structure tree root whose PDSRoleMap is removed.
Returns
voidPDSTreeRootReplaceKid
void PDSTreeRootReplaceKid(IN PDSTreeRoot treeRoot, IN PDSElement oldKid, IN PDSElement newKid)Replaces structural element oldKid with element newKid as a kid of treeRoot . This may raise various exceptions.
Parameters
treeRoot: IN PDSTreeRootoldKid: IN PDSElementnewKid: IN PDSElement
Returns
voidPDSTreeRootReplaceStreamRef
void PDSTreeRootReplaceStreamRef(PDSTreeRoot treeRoot, CosObj oldStream, CosObj newStream)Updates the stream entries (Stm) in marked content reference dictionaries to reference a new Cos stream object. It replaces references to the old stream with refererences to the new stream. This may raise various exceptions.
Parameters
treeRoot: PDSTreeRootThe structure tree root in which stream references are updated.
oldStream: CosObjThe stream reference to replace.
newStream: CosObjThe stream reference that is replacing oldStream .
Returns
voidTypedefs(1)
PDSTreeRoot
typedef CosObj PDSTreeRootThe root of the structure tree, which is a central repository for information related to a PDF document's logical structure. There is at most one PDSTreeRoot in each document.