Layer

PDSEdit Layer

7 components134 items
101 Functions 20 Definitions 11 Typedefs 1 Structures 1 Enums

General

22 items

Typedefs(1)

Enums(1)

PDSType

PDSExpT.h:164

PDS object types.

Values
kPDSElement
kPDSAttrObj
kPDSMCR
kPDSMC
kPDSRoleMap
kPDSClassMap
kPDSLastType

Definitions(20)

IN

PDSExpT.h:46

OUT

PDSExpT.h:47

PDSAttrObj

5 items

Functions(4)

PDSAttrObjCreate

void PDSAttrObjCreate(IN PDDoc pdDoc, IN ASAtom owner, IN ASBool indirect, OUT PDSAttrObj *attrObj)
PDSWriteProcs.h:582

Creates a new attribute object with the specified owner. This may raise various exceptions.

Parameters
pdDoc: IN PDDoc

The document in which the attribute object is created.

owner: IN ASAtom

The owner of the new attribute object.

indirect: IN ASBool

If 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
void

PDSAttrObjCreateFromStream

void PDSAttrObjCreateFromStream(IN ASAtom owner, IN OUT CosObj cosStreamObj, OUT PDSAttrObj *attrObj)
PDSWriteProcs.h:598

Creates an attribute object with the specified owner from the specified Cos stream.

Parameters
owner: IN ASAtom

The owner of the new attribute object.

cosStreamObj: IN OUT CosObj

The 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
void

PDSAttrObjGetCosObj

PDSReadProcs.h:810

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: PDSAttrObj

The attribute object whose Cos object is obtained.

Returns
CosObj

The dictionary Cos object for the attribute object.

Typedefs(1)

PDSClassMap

6 items

Functions(5)

PDSClassMapAddAttrObj

void PDSClassMapAddAttrObj(IN PDSClassMap classMap, IN ASAtom classAtom, IN PDSAttrObj attrObj)
PDSWriteProcs.h:682

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 PDSClassMap

The PDSClassMap to which the specified attribute object is added.

classAtom: IN ASAtom

The ASAtom representing the class name.

attrObj: IN PDSAttrObj

The attribute object to add to the class in classAtom .

Returns
void

PDSClassMapGetAttrObj

void PDSClassMapGetAttrObj(IN PDSClassMap classMap, IN ASAtom classAtom, IN ASInt32 index, OUT PDSAttrObj *attrObj)
PDSReadProcs.h:593

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 PDSClassMap

The PDSClassMap.

classAtom: IN ASAtom

The ASAtom of a class name for which an associated attribute objects is found.

index: IN ASInt32

The 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
void

PDSClassMapGetNumAttrObjs

PDSReadProcs.h:570

Gets the number of attribute objects associated with a class name. This may throw various exceptions.

Parameters
classMap: IN PDSClassMap

IN/OUT The PDSClassMap.

classAtom: IN ASAtom

IN/OUT The ASAtom of a class name for which the number of associated attribute objects is found.

Returns
ASInt32

The number of attribute objects associated with the class in classAtom .

PDSClassMapRemoveAttrObj

void PDSClassMapRemoveAttrObj(IN PDSClassMap classMap, IN ASAtom classAtom, IN PDSAttrObj attrObj)
PDSWriteProcs.h:714

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 PDSClassMap

The PDSClassMap from which the specified attribute object is removed.

classAtom: IN ASAtom

The ASAtom of a class name for which the associated attribute object is found.

attrObj: IN PDSAttrObj

The attribute object to remove from classMap .

Returns
void

Typedefs(1)

PDSClassMap

PDSExpT.h:139

Associates 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

PDSReadProcs.h:841

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: PDDoc

The PDDoc whose structure elements are to be enumerated.

proc: EnumElementsWithUserPropertiesProc

The procedure to call for each PDSElement found to have UserProperties.

clientData: void *

Client-supplied data to be passed to the client callback.

Returns
ASBool

true if the enumeration completes, false if the enumeration callback returns false .

PDDocHasUserProperties

PDSReadProcs.h:825

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: PDDoc

The PDDoc to be examined.

Returns
ASBool

An ASBool indicating whether the document declares that it has structure elements with UserProperties attributes or classes.

PDSElementCreate

void PDSElementCreate(IN PDDoc pdDoc, OUT PDSElement *element)
PDSWriteProcs.h:200

Creates a new (but empty) PDSElement. This may raise various exceptions.

Parameters
pdDoc: IN PDDoc

The PDDoc in which the PDSElement is created.

element: OUT PDSElement *

(Filled by the method) The newly created PDSElement.

Returns
void

PDSElementEnumKidsWithUserProperties

PDSReadProcs.h:933

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: PDSElement

The PDSElement below which to search for elements with user properties.

proc: EnumElementsWithUserPropertiesProc

The client-supplied callback to call for each element found.

clientData: void *

Client-supplied data to be passed to the client callback.

Returns
ASBool

true if the enumeration completes, false if the enumeration callback returns false .

PDSElementEnumUserPropertiesAsASText

PDSReadProcs.h:872

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: PDSElement

The PDSElement whose user properties will be enumerated.

proc: PDSElementEnumUserPropertiesAsASTextProc

The callback that is called for each user property item.

clientData: void *

Client-supplied data to be passed to the client callback.

includeHidden: ASBool

A boolean value indicating whether the client wants to be given property items that are marked as hidden.

Returns
ASBool

true if the enumeration completes, false if the enumeration callback returns false .

PDSElementEnumUserPropertiesAsCosObj

PDSReadProcs.h:895

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: PDSElement

The PDSElement whose user properties will be enumerated.

proc: PDSElementEnumUserPropertiesAsCosObjProc

The callback that is called for each user property item.

clientData: void *

Client-supplied data to be passed to the client callback.

includeHidden: ASBool

A boolean value indicating whether the client wants to be given property items that are marked as hidden.

Returns
ASBool

true if the enumeration completes, false if the enumeration callback returns false .

PDSElementExportUserProperties

ASErrorCode PDSElementExportUserProperties(PDSElement userPropsElement, ASBool wholeSubtree, ASBool includeHidden, ASBool flattenClasses, PDUserPropertiesXMLLabels xmlLabels, ASStm output)
PDSReadProcs.h:1009

Exports user properties of the specified PDSElement in XML.

Parameters
userPropsElement: PDSElement

The element whose user properties are to be exported in XML format.

wholeSubtree: ASBool

A 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: ASBool

A boolean value indicating whether the client wants to be given property items that are marked as hidden.

flattenClasses: ASBool

A 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: PDUserPropertiesXMLLabels

The 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: ASStm

The output stream to which user properties are written. The encoding of the characters is UTF-8.

Returns
ASErrorCode

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.

PDSElementFindAncestorWithUserProperties

PDSReadProcs.h:909

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: PDSElement

The PDSElement at which to start searching upwards through the tree.

Returns
PDSElement

The first ancestor of elem that contains UserProperties attributes or class information, or CosNull if none is found.

PDSElementGetActualText

PDSReadProcs.h:653

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 PDSElement

The 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
ASInt32

An ASInt32 representing the number of bytes in the text, or 0 if the element has no actual text.

PDSElementGetActualTextASText

PDSReadProcs.h:963

Gets the actual text associated with the specified PDSElement as an ASText object.

Parameters
element: PDSElement

The 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
void

PDSElementGetAlt

PDSReadProcs.h:328

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 PDSElement

The 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
ASInt32

The number of bytes in the element parameter's alternate text.

PDSElementGetAltASText

PDSReadProcs.h:981

Gets the alternate text associated with the specified PDSElement as an ASText object.

Parameters
element: PDSElement

The 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
void

PDSElementGetAttrObj

PDSReadProcs.h:260

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 PDSElement

IN/OUT The element whose attribute is obtained.

index: IN ASInt32

IN/OUT The index of the attribute object to obtain.

attrObj: OUT PDSAttrObj *

IN/OUT (Filled by the method) The attribute object at index .

Returns
ASInt32

The revision number of element at time of last association.

PDSElementGetClass

PDSReadProcs.h:296

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 PDSElement

The element whose class is obtained.

index: IN ASInt32

The index of the class to obtain.

classAtom: OUT ASAtom *

(Filled by the method) The ASAtom describing the class.

Returns
ASInt32

The revision number of element at the time of the last association.

PDSElementGetCosObj

PDSReadProcs.h:800

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: PDSElement

The element object whose Cos object is obtained.

Returns
CosObj

The dictionary Cos object for the element object.

PDSElementGetFirstPage

CosObj PDSElementGetFirstPage(IN PDSElement pdsElement, OUT ASAtom *firstKidType, OUT CosObj *firstCosObjKidOnAPage, OUT PDEContainer *firstMCKidOnAPage)
PDSReadProcs.h:425

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 PDSElement

IN/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
CosObj

The CosObj of the page found, CosObjNull if the element has no page content.

PDSElementGetKid

ASAtom PDSElementGetKid(IN PDSElement element, IN ASInt32 index, OUT CosObj *cosObjKid, OUT void **pointerKid, OUT CosObj *cosPage)
PDSReadProcs.h:392

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.

When the kid is an MC, it is actually a pointer of the type PDEContainer. As with all PDFEdit objects, you must be careful to manage the reference count of the object by calling PDEAcquire() and PDERelease(). PDSElementGetKid() does not call PDEAcquire() for you. This method cannot access marked content inside a Form XObject.

Parameters
element: IN PDSElement
index: IN ASInt32
cosObjKid: 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
ASAtom

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)
PDSReadProcs.h:626

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 PDSElement

The PDSElement containing the kid that is retrieved.

index: IN ASInt32

The 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
ASAtom

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)
PDSReadProcs.h:740

Functions identically to PDSElementGetKidEx(), but returns additional information about marked content kids that are in streams other than the page content streams.

Parameters
element: PDSElement

The PDSElement containing the kid that is retrieved.

index: ASInt32

The 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
ASAtom

An ASAtom representing the Type value of the kid.

PDSElementGetLanguage

PDSReadProcs.h:683

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 PDSElement

The 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
ASInt32

An ASInt32 representing the number of bytes in the language string.

PDSElementGetParent

void PDSElementGetParent(IN PDSElement element, OUT PDSElement *parent, OUT ASBool *parentIsTreeRoot)
PDSReadProcs.h:186

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 PDSElement

The 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
void

PDSElementGetStructTreeRoot

PDSReadProcs.h:461

Gets the structure tree root of the document containing element.

Parameters
element: IN PDSElement

The element whose title is obtained.

treeRoot: OUT PDSTreeRoot *

(Filled by the method) The structure tree root.

Returns
ASBool

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.

PDSElementGetTitle

PDSReadProcs.h:209

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.

Due to implementation issues, make the buffer one byte larger than the required size.

Parameters
element: IN PDSElement
buffer: OUT ASUns8 *
Returns

PDSElementGetType

PDSReadProcs.h:161

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 PDSElement

The element whose structural element type is obtained.

Returns
ASAtom

The ASAtom representing element's type.

PDSElementInsertKid

void PDSElementInsertKid(IN PDSElement element, IN PDSElement kid, IN ASInt32 insertAfter)
PDSWriteProcs.h:389

Inserts the specified kid PDSElement object into the specified element after position insertAfter .

Parameters
element: IN PDSElement

The element in which the specified kid is inserted.

kid: IN PDSElement

The kid to insert.

insertAfter: IN ASInt32

The position after which the kid is inserted. If element currently has no kids, insertAfter is ignored.

Returns
void

PDSElementInsertMCAsKid

void PDSElementInsertMCAsKid(IN PDSElement element, IN CosObj cosPage, IN PDSMC mc, IN ASInt32 insertAfter)
PDSWriteProcs.h:413

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 PDSElement

The element in which the reference is inserted.

cosPage: IN CosObj

The CosObj for the page containing the reference to insert.

mc: IN PDSMC

The marked content to insert.

insertAfter: IN ASInt32

The position after which the reference is inserted. If element currently has no kids, insertAfter is ignored.

Returns
void

PDSElementInsertMCAsKidEx

void PDSElementInsertMCAsKidEx(IN PDSElement element, IN CosObj cosPage, IN PDSMC mc, IN ASInt32 insertAfter, IN CosObj cosStream, IN CosObj streamOwner)
PDSWriteProcs.h:796

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 PDSElement

The element in which the reference is inserted.

cosPage: IN CosObj

The CosObj for the page containing the reference to insert.

mc: IN PDSMC

The marked content to insert.

insertAfter: IN ASInt32

The position after which the reference is inserted. If element currently has no kids, insertAfter is ignored.

cosStream: IN CosObj

The stream containing the content given by mc .

streamOwner: IN CosObj

A Cos object to record as the owner of the content. It can be CosNull if the owner is not important.

Returns
void

PDSElementInsertMCRefAsKid

PDSWriteProcs.h:906

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 PDSElement

The structure element with which to associate marked content.

ref: IN PDSMCRef

The 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 ASInt32

The 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

PDSElementInsertStmMCAsKid

void PDSElementInsertStmMCAsKid(PDSElement element, CosObj cosPage, CosObj containingStm, CosObj stmOwner, PDSMC mc, ASInt32 insertAfter)
PDSWriteProcs.h:825

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: PDSElement

The element in which the reference is inserted.

cosPage: CosObj

The CosObj for the page containing the reference to insert.

containingStm: CosObj

The stream containing the content given by mc .

stmOwner: CosObj

The 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: PDSMC

The marked content to insert.

insertAfter: ASInt32

The position after which the reference is inserted. If element currently has no kids, insertAfter is ignored.

Returns
void

PDSElementRemoveAttrObj

PDSWriteProcs.h:282

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 PDSElement

The element whose attribute is removed.

attrObj: IN PDSAttrObj

The attribute object to remove.

Returns
void

PDSElementRemoveClass

void PDSElementRemoveClass(IN PDSElement element, IN ASAtom classAtom)
PDSWriteProcs.h:336

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 PDSElement

The element from which the specified class is removed.

classAtom: IN ASAtom

The ASAtom representing the class to remove.

Returns
void

PDSElementRemoveKidMC

void PDSElementRemoveKidMC(IN PDSElement element, IN CosObj cosPage, IN PDSMC mc)
PDSWriteProcs.h:469

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 PDSElement

The element whose reference is removed.

cosPage: IN CosObj

The CosObj for the page containing the reference to remove.

mc: IN PDSMC

The marked content to remove.

Returns
void

PDSElementReplaceKid

void PDSElementReplaceKid(IN PDSElement element, IN CosObj oldKid, IN CosObj newKid)
PDSWriteProcs.h:489

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 PDSElement

IN/OUT The element whose kid is replaced.

oldKid: IN CosObj

IN/OUT The kid to replace.

newKid: IN CosObj

IN/OUT The kid that is replacing oldKid .

Returns
void

PDSElementReplaceKidMC

void PDSElementReplaceKidMC(IN PDSElement element, IN CosObj oldCosPage, IN PDSMC oldMC, IN CosObj newCosPage, IN PDSMC newMC)
PDSWriteProcs.h:509

Replaces the specified PDSMC (on oldCosPage ) with a new PDSMC (on newCosPage ) in the specified element. This may raise various exceptions.

Parameters
element: IN PDSElement

The element whose reference is replaced.

oldCosPage: IN CosObj

The CosObj for the page holding the reference to replace.

oldMC: IN PDSMC

The marked content to replace.

newCosPage: IN CosObj

The CosObj for the page holding the reference that is replacing oldMC .

newMC: IN PDSMC

The marked content that is replacing oldMC .

Returns
void

PDSElementReplaceKidOBJ

void PDSElementReplaceKidOBJ(IN PDSElement element, IN CosObj oldObj, IN CosObj newObj, IN CosObj newPage)
PDSWriteProcs.h:527

Replaces oldObj with newObj on the specified page in the specified element. This may raise various exceptions.

Parameters
element: IN PDSElement

IN/OUT The element whose object is replaced.

oldObj: IN CosObj

IN/OUT The object to replace.

newObj: IN CosObj

IN/OUT The object that is replacing oldObj .

newPage: IN CosObj

IN/OUT The CosObj for the page holding the reference that is replacing oldObj .

Returns
void

PDSElementSetActualText

void PDSElementSetActualText(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes)
PDSWriteProcs.h:730

Sets the actual text representation of the specified PDSElement object's contents to buffer (from 0 to nBytes ).

Parameters
element: IN PDSElement

The 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 ASInt32

The number of bytes in the text representation.

Returns
void

PDSElementSetAlt

void PDSElementSetAlt(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes)
PDSWriteProcs.h:369

Sets the alternate text representation of an element's contents.

Parameters
element: IN PDSElement

IN/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 ASInt32

IN/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
void

PDSElementSetID

void PDSElementSetID(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes)
PDSWriteProcs.h:545

Sets the ID of an element to the given Cos string.

Parameters
element: IN PDSElement

The 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 ASInt32

The 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
void

PDSElementSetLanguage

void PDSElementSetLanguage(IN PDSElement element, IN const ASUns8 *buffer, IN ASInt32 nBytes)
PDSWriteProcs.h:752

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 PDSElement

The 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 ASInt32

The 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
void

PDSElementSetType

PDSWriteProcs.h:218

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 PDSElement

The element whose type is set.

type: IN ASAtom

The ASAtom representing the element's type.

Returns
void

PDSOBJGetParent

PDSReadProcs.h:517

Gets the parent element of the specified PDF object. This may throw various exceptions.

Parameters
obj: IN CosObj

IN/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
void

Typedefs(4)

PDSMC

9 items

Functions(6)

PDSMCGetInfo

void PDSMCGetInfo(CosObj containingObj, PDSMC mc, PDSMCInfoP info)
PDSReadProcs.h:759

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: CosObj

The 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: PDSMC

The 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
void

PDSMCGetParent

void PDSMCGetParent(IN CosObj containingObj, IN PDSMC mc, OUT PDSElement *parent)
PDSReadProcs.h:500

Gets the parent element of the specified marked content.

Parameters
containingObj: IN CosObj

The 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 PDSMC

The marked content whose parent is obtained.

parent: OUT PDSElement *

(Filled by the method) The parent element of containingObj .

Returns
void

PDSMCIDGetParent

ASBool PDSMCIDGetParent(ASInt32 mcid, CosObj containingObj, PDSElement *parent)
PDSReadProcs.h:781

Gets the parent element of the specified marked content, referred to by its containing object and marked-content identifier.

Parameters
mcid: ASInt32

The identifier (MCID) of the marked content whose parent is obtained.

containingObj: CosObj

The 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
ASBool

true if the parent is successfully obtained, false otherwise.

PDSMCRefCreate

PDSWriteProcs.h:868

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 PDEElement

The marked content to create a reference for. It must be either a PDEContainer or PDEBeginContainer.

cosDoc: IN CosDoc

The document within which the reference will be used.

mcid: IN ASInt32

The mcid to set for the container.

Returns

PDSMCRefDestroy

PDSWriteProcs.h:884

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 PDSMCRef

The marked content reference to destroy.

Returns
void

Typedefs(2)

PDSMC

PDSExpT.h:117

Represents 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.

Structures(1)

PDSMCRef

typedef struct _t_PDSMCRef* PDSMCRef
PDSExpT.h:151

An opaque pointer type to a marked content reference handle.

PDSRoleMap

7 items

Functions(6)

PDSRoleMapCopy

void PDSRoleMapCopy(IN PDSRoleMap srcRoleMap, IN PDSTreeRoot dstTreeRoot, OUT PDSRoleMap *dstRoleMap)
PDSWriteProcs.h:660

Makes a copy of a PDSRoleMap, making it the PDSRoleMap of the specified StructTreeRoot. This may raise various exceptions.

Parameters
srcRoleMap: IN PDSRoleMap

The PDSRoleMap to copy.

dstTreeRoot: IN PDSTreeRoot

The 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
void

PDSRoleMapDoesMap

PDSReadProcs.h:552

Determines whether the specified PDSRoleMap provides any mapping path for two given element types.

Parameters
roleMap: IN PDSRoleMap

IN/OUT The PDSRoleMap.

src: IN ASAtom

IN/OUT The ASAtom for an element type whose mapping is tested.

dst: IN ASAtom

IN/OUT The ASAtom for an element type. Note that this may be a standard element type.

Returns
ASBool

true if an mapping path was found, false otherwise.

See Also

PDSRoleMapGetDirectMap

PDSReadProcs.h:536

Gets the type, if any, directly mapped in the specified PDSRoleMap for the given element type.

Parameters
roleMap: IN PDSRoleMap

The PDSRoleMap.

type: IN ASAtom

The ASAtom for an element type whose mapping is found.

Returns
ASAtom

The ASAtom for the equivalent type specified in roleMap , or ASAtomNull if type has no mapping in roleMap .

PDSRoleMapMap

void PDSRoleMapMap(IN PDSRoleMap roleMap, IN ASAtom src, IN ASAtom dst)
PDSWriteProcs.h:616

Maps an element type ( src ) to another element type ( dst ) in the specified PDSRoleMap.

Parameters
roleMap: IN PDSRoleMap

The PDSRoleMap in which to create a new mapping.

src: IN ASAtom

The element type to map to dst .

dst: IN ASAtom

The element type that src maps onto. Note that this may be a standard element type, such as P.

Returns
void

PDSRoleMapUnMapDst

PDSWriteProcs.h:644

Makes the specified element type have no mapping.

Parameters
roleMap: IN PDSRoleMap

The PDSRoleMap in which to un-map all element types that map onto the dst element type.

dst: IN ASAtom

The element type to which all mappings are removed. All element types that map to the dst element type are unmapped.

Returns
void

PDSRoleMapUnMapSrc

void PDSRoleMapUnMapSrc(IN PDSRoleMap roleMap, IN ASAtom src, IN ASBool fixupOthers)
PDSWriteProcs.h:632

Makes the specified element type have no mapping. This may raise various exceptions.

Parameters
roleMap: IN PDSRoleMap

IN/OUT The PDSRoleMap in which to un-map the src element type.

src: IN ASAtom

IN/OUT The element type whose mapping is removed.

fixupOthers: IN ASBool

IN/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
void

Typedefs(1)

PDSRoleMap

PDSExpT.h:130

Represents 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

PDSWriteProcs.h:66

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 PDDoc

IN/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
void

PDSTreeRootCreateClassMap

PDSWriteProcs.h:171

Creates a PDSClassMap in the specified tree root. Any previously existing PDSClassMap is unlinked. This may raise various exceptions.

Parameters
treeRoot: IN PDSTreeRoot

The structure tree root in which to create a PDSClassMap.

classMap: OUT PDSClassMap *

(Filled by the method) The newly created PDSClassMap.

Returns
void

PDSTreeRootCreateRoleMap

PDSWriteProcs.h:140

Creates and sets the PDSRoleMap of the specified StructTreeRoot element. Any previously existing PDSRoleMap is unlinked. This may raise various exceptions.

Parameters
treeRoot: IN PDSTreeRoot

The structure tree root in which to create a PDSRoleMap.

roleMap: OUT PDSRoleMap *

(Filled by the method) The newly created PDSRoleMap.

Returns
void

PDSTreeRootGetClassMap

PDSReadProcs.h:120

Gets the PDSClassMap object for the specified structure tree root. This may throw various exceptions.

Parameters
treeRoot: IN PDSTreeRoot

The 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
ASBool

true if there is a class map, false otherwise.

PDSTreeRootGetRoleMap

PDSReadProcs.h:103

Gets the PDSRoleMap object for the specified structure tree root. This may throw various exceptions.

Parameters
treeRoot: IN PDSTreeRoot

The 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
ASBool

true if there is a role map, false otherwise.

PDSTreeRootInsertKid

void PDSTreeRootInsertKid(IN PDSTreeRoot treeRoot, IN PDSElement kid, IN ASInt32 insertAfter)
PDSWriteProcs.h:95

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 PDSTreeRoot

IN/OUT The structure tree root in which a kid is inserted.

kid: IN PDSElement

IN/OUT The kid to insert.

insertAfter: IN ASInt32

IN/OUT The position after which the kid is inserted. If element currently has no kids, insertAfter is ignored.

Returns
void

PDSTreeRootReplaceStreamRef

void PDSTreeRootReplaceStreamRef(PDSTreeRoot treeRoot, CosObj oldStream, CosObj newStream)
PDSWriteProcs.h:842

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: PDSTreeRoot

The structure tree root in which stream references are updated.

oldStream: CosObj

The stream reference to replace.

newStream: CosObj

The stream reference that is replacing oldStream .

Returns
void

Typedefs(1)