DL Logo

PDEContent Enumerations

PDEContentFlags

Header: PEExpT.h:1719

Description

A bit field for PDEContentAttrs.

Enum Constants

kPDESetCacheDevice=0x0001
If set, cacheDevice contains 6 cache device values.
kPDESetCharWidth=0x0002
If set, cacheDevice contains 2 charwidth values.
kPDEFormMatrix=0x0004
If set, formMatrix contains a valid matrix.

PDEContentGetResourceFlags

Header: PEExpT.h:1701

Description

A bit field for PDEContentAttrs.

Related Methods

Enum Constants

kPDEGetFonts
Obtain font resources.
kPDEGetXObjects
Obtain Xobject resources.
kPDEGetColorSpaces
Obtain color space resources.

PDEContentToCosObjFlags

Header: PEExpT.h:1612

Description

A bit field for the PDEContentToCosObj() method, indicating the type of object to create and how it is created. To learn about color operators, see the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, page 171. You can find this document on the web store of the International Standards Organization (ISO).

Related Methods

Enum Constants

kPDEContentToPage=0x0001
Create page contents.
kPDEContentToForm=0x0002
Create a form.
kPDEContentToCharProc=0x0004
Create charprocs.
kPDEContentRev1Compat=0x0008
Currently unused.
kPDEContentDoNotResolveForms=0x0010
Currently unused.
kPDEContentDoNotResolveType3=0x0020
Currently unused.
kPDEContentEmitDefaultRGBAndGray=0x0040
Emit calibrated RGB and gray information using the PDF 1.0 compatible mechanism. In this case, generate rg and k page operators and place DefaultGray and DefaultRGB color space arrays in the Resources dictionary. See the Color Operators section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, section 8.6.8, page 171.
kPDEContentInheritState=0x0080
kPDEContentDoNotEmitBXEX=0x0100
Prevents the emission of the content compatibility operators, BX/EX, which cause issues for some versions of PDF/A or PDF/X.
kPDEContentUseMaxPrecision=0x0200
By default 3 digit precision after decimal point is used for floating point values. Using this flag increases precision from 3 digits to 5 digits after decimal point.
kPDEContentUseSpaceAsEOL=0x0400
Use a space character as the EOL character in the content stream to make the Flate compressor more effective.
kPDEContentHonorWasSetFlags=0x0800
Emit a gstate or textstate parameter for any element, only if the corresponding WasSetFlag is set.
kPDEContentSkipBBox=0x1000
Setting this flag will skip optimization of bounding box of form XObject.
kPDEContentSkipResReset=0x2000
Setting this flag will skip resetting of ResTable in PDEContent and it also skips creating new resource dictionary in document and uses resource dictionary from input.
kPDEContentFormFromPage=0x20000
Note that this form content was created from a page, and should never inherit any state from the calling code, * * nor allow any state to leak from the form

PDEContent Typedefs

PDEContent

Header: PEExpT.h:122

Description

Contains the modifiable contents of a PDPage. A PDEContent object may be obtained from an existing page, from a Form XObject, or from a Type 3 CharProc. You can create an empty PDEContent object. A PDEContent object contains PDEElement objects. In addition, a PDEContent object may have attributes such as a Form matrix and setcachedevice parameters.

Related Methods

Syntax

typedef struct _t_PDEContent *PDEContent;

Returned From

Used By

PDEContent Structures

_t_PDEContentAttrs

Header: PEExpT.h:442

Description

A structure describing attributes of a PDEContent object.

Syntax

struct _t_PDEContentAttrs {
ASUns32 flags;
ASFixed cacheDevice [8];
If flags has kPDESetCacheDevice set, the first six cache device values contain the operands for the d1 ( setcachedevice) page operator. If flags has kPDESetCacheDevice set, cacheDevice contains two charwidth values.
ASInt32 formType;
Only used if PDEContent contains a Form XObject. It corresponds to FormType key in the XObject Form attributes dictionary.
Only used if PDEContent contains a Form. It is the bounding box of the PDEContent object. It corresponds to the BBox key in the XObject Form attributes dictionary.
ASFixedMatrix matrix;
Only used if PDEContent contains a Form. It is the transformation matrix for the PDEContent object. It corresponds to the Matrix key in the XObject Form attributes dictionary.
CosObj XUID;
Only used if PDEContent contains a Form. It is the form's XUID, which is an ID that uniquely identifies the form. It corresponds to the XUID key in the XObject Form attributes dictionary.
} PDEContentAttrs, *PDEContentAttrsP;

Used By

PDEContent Functions

PDEContentAddElem

Header: PEWProcs.h:147

Description

Inserts an element into a PDEContent.

Note: This method increments the reference count of pdeElement.

Related Methods

Syntax

void PDEContentAddElem(IN PDEContent pdeContent, IN ASInt32 addAfterIndex, IN PDEElement pdeElement);

Parameters

pdeContent
The content to which pdeElement is added.
addAfterIndex
The location after which pdeElement is added. It should be kPDEBeforeFirst to add to the beginning of the display list.
pdeElement
The element to add to pdeContent. The reference count of pdeElement is incremented.

Exceptions

PDEContentAddPage

Header: PEWProcs.h:1621

Description

Superseded by PDEContentAddPageEx() in Acrobat 10.0. Adds the specfied PDPage to the PDEContent as an Xobject form. It adds a reference to the Xobject form at the indicated index in the PDE Content; the index may be less than 0, which indicates the object is to be appended to the content.

Related Methods

Syntax

void PDEContentAddPage(OUT PDEContent theContent, IN ASInt32 insertAfterIndex, IN CosDoc containerDoc, IN PDPage srcPage, IN ASFixedMatrix *dstMatrix, IN ASAtom annotTypes [], IN ASInt32 flags, IN ASFixedRect *bbox);

Parameters

theContent
The content to set for the page.
insertAfterIndex
The index indicates the location after which the specified element is to be added. The index should be kPDBeforeFirst to add to the beginning of the display list.
containerDoc
The CosDoc in which the page is contained.
srcPage
The page that will be inserted at insertAfterIndex in theContent.
dstMatrix
(May be NULL) The matrix applied to the default matrix of the PDPage that is inserted into the CosDoc.
annotTypes
If the page contains annotations, the annotTypes list is used to determine which annotation types are pumped into the page contents of the CosDoc. This list is a list of atoms of the subtypes of annotations to be included. When the list is NULL, all Annotations are excluded. NOTE: The annotations included will not be included AS annotations. Rather, visible Annotations will be included in content.
flags
(May be 0)- may be one of:
Value
Description
Copy all annotation types. If this is not set, then the annotTypes list will be consulted.
Do not merge duplicate fonts when copying.
bbox
(May be NULL) specifies the destination BBox for the page being inserted. If it is NULL, the new page's media box is used.

PDEContentAddPageEx

Header: PEWProcs.h:3287

Description

Adds the specfied PDPage to the PDEContent as an Xobject form. Supersedes PDEContentAddPage() in Acrobat 10.0. It adds a reference to the Xobject form at the indicated index in the PDE Content; the index may be less than 0, which indicates the object is to be appended to the content.

Related Methods

Syntax

void PDEContentAddPageEx(OUT PDEContent theContent, IN ASInt32 insertAfterIndex, IN CosDoc containerDoc, IN PDPage srcPage, IN ASDoubleMatrix *dstMatrix, IN ASAtom annotTypes [], IN ASInt32 flags, IN ASDoubleRect *bbox);

Parameters

theContent
The content to set for the page.
insertAfterIndex
The index indicates the location after which the specified element is to be added. The index should be kPDBeforeFirst to add to the beginning of the display list.
containerDoc
The CosDoc in which the page is contained.
srcPage
The page that will be inserted at insertAfterIndex in theContent.
dstMatrix
(May be NULL) The matrix applied to the default matrix of the PDPage that is inserted into the CosDoc.
annotTypes
If the page contains annotations, the annotTypes list is used to determine which annotation types are pumped into the page contents of the CosDoc. This list is a list of atoms of the subtypes of annotations to be included. When the list is NULL, all Annotations are excluded. NOTE: The annotations included will not be included AS annotations. Rather, visible Annotations will be included in content.
flags
(May be 0)- may be one of:
Value
Description
Copy all annotation types. If this is not set, then the annotTypes list will be consulted.
Do not merge duplicate fonts when copying.
bbox
(May be NULL) specifies the destination BBox for the page being inserted. If it is NULL, the new page's media box is used.

PDEContentCopyResTable

Header: PERProcs.h:3489

Description

Copies ResTable indexes count from source PDEContent to destination PDEContent.

Syntax

void PDEContentCopyResTable(PDEContent src, PDEContent dst);

Parameters

path
IN The PDEContent whose ResTable data is to be copied.
data
IN/OUT Destination PDEContent whose ResTable data is to be updated.

Returns

None

PDEContentCreate

Header: PEWProcs.h:49

Description

Creates an empty content object.

Call PDERelease() to dispose of the returned content object when finished with it.

Note: Do not use this method to create a PDEContent to be put into a PDPage. Instead, call PDPageAcquirePDEContent().

Syntax

PDEContent PDEContentCreate(void);

Returns

An empty content object.

Exceptions

PDEContentCreateFromCosObj

Header: PERProcs.h:108

Description

Creates a content object from a Cos object. This is the main method for obtaining a PDEContent object.

Call PDERelease() to dispose of the returned content object when finished with it.

Syntax

PDEContent PDEContentCreateFromCosObj(const CosObj *contents, const CosObj *resources);

Parameters

contents
IN/OUT A Cos object that is the source for the content. It may be page contents, a Form XObject, a Type 3 font CharProc, or an appearance dictionary for an annotation.
resources
IN/OUT The object's Resources dictionary. If the Form or Type 3 font or appearance dictionary contains a Resources dictionary, this dictionary must be passed in resources. Otherwise, it must be the page resources object of the page containing the Form or Type 3 font contents object.

Returns

The content from the Cos object.

Exceptions

PDEContentFlattenOC

Header: PEWProcs.h:2340

Description

Flattens the content, removing any PDEElement objects that are not visible in the given optional-content context, and removing the optional-content information from any visible PDFElement objects.

Syntax

ASBool PDEContentFlattenOC(PDEContent content, PDOCContext context);

Parameters

content
The content to be modified.
context
The optional-content context in which content is checked for visibility.

Returns

true if the operation is successful, false otherwise.

PDEContentGetAttrs

Header: PERProcs.h:120

Description

Gets the attributes of a content.

Syntax

void PDEContentGetAttrs(IN PDEContent pdeContent, OUT PDEContentAttrsP attrsP, IN ASUns32 attrsSize);

Parameters

pdeContent
IN/OUT A content object.
attrsP
IN/OUT (Filled by the method) A pointer to a PDEContentAttrs structure containing the attributes of the content.
attrsSize
IN/OUT The size of the attrsP buffer in bytes.

Exceptions

PDEContentGetDefaultColorSpace

Header: PERProcs.h:1844

Description

Gets a default color space from a PDEContent object.

See the "Default Color Spaces" section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, under "CIE-Based Color Spaces" in section 8.6.5.6, page 152. You can find this document on the web store of the International Standards Organization (ISO).

Note: This method does not change the reference count of the returned PDEColorSpace.

Related Methods

Syntax

PDEColorSpace PDEContentGetDefaultColorSpace(IN PDEContent pdeContent, IN ASAtom colorSpaceName);

Parameters

pdeContent
IN/OUT A content object.
colorSpaceName
IN/OUT An ASAtom for the name of the desired color space. It must be an ASAtom for one of DefaultRGB, DefaultCMYK, or DefaultGray.

Returns

The desired color space in pdeContent. It returns NULL if colorSpaceName does not correspond to a known default, such as DefaultRGB.

PDEContentGetElem

Header: PERProcs.h:170

Description

Gets the requested element from a content.

Note: This method does not change the reference count of the element.

Note: This method does not copy the element.

Related Methods

Syntax

PDEElement PDEContentGetElem(IN PDEContent pdeContent, IN ASInt32 index);

Parameters

pdeContent
IN/OUT A content object.
index
IN/OUT The index of element to obtain.

Returns

The requested element.

Exceptions

PDEContentGetElemsStatus

Header: PERProcs.h:3439

Syntax

ASUns32 PDEContentGetElemsStatus(IN PDEContent pdeContent);

PDEContentGetNumElems

Header: PERProcs.h:153

Description

Gets the number of elements in a PDEContent object.

Related Methods

Syntax

ASInt32 PDEContentGetNumElems(IN PDEContent pdeContent);

Parameters

pdeContent
IN/OUT A content object.

Returns

The number of elements in pdeContent.

Exceptions

PDEContentGetResources

Header: PERProcs.h:142

Description

Gets the number of resources of the specified type and, optionally, gets the pointers to the resource objects.

Syntax

ASInt32 PDEContentGetResources(IN PDEContent pdeContent, IN ASInt32 type, OUT PDEObject *resourcesP);

Parameters

pdeContent
IN/OUT A content object.
type
IN/OUT The type of resources to query or obtain: PDEFont, PDEXGroup, or PDEColorSpace. It must be one of PDEContentGetResourceFlags.
resourcesP
IN/OUT (Filled by the method) If non- NULL, it must point to an array of PDEObject pointers. On return, the array contains pointers to the requested resources. If resourcesP is NULL, only the number of resources of type is returned. Note that the object in resourcesP may only be valid for this method. Use PDEAcquire() if you need to hold on to the object longer than the scope of resourcesP.

Returns

The number of resources of type returned in resourcesP.

Exceptions

PDEContentRemoveElem

Header: PEWProcs.h:127

Description

Removes an element from a PDEContent.

Note: This decrements the reference count of the element removed.

Related Methods

Syntax

void PDEContentRemoveElem(IN PDEContent pdeContent, IN ASInt32 index);

Parameters

pdeContent
IN/OUT A content object.
index
IN/OUT The index in pdeContent of the element to remove whose reference count is decremented.

Exceptions

PDEContentSetContainingStream

Header: PEWProcs.h:2741

Description

Sets the containing stream and owner stream for any marked content reference handles attached to containers within the content.

Note: This call should not be used when the content is being directly added to a page.

Note: If the content is set with PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent(), this step occurs automatically.

Syntax

void PDEContentSetContainingStream(IN PDEContent pdeContent, IN CosObj containingStm);

Parameters

pdeContent
The content stream within which to update marked content references.
containingStm
The containing stream object for the content stream.

PDEContentSetDefaultColorSpace_PEWCalls_

Header: PEWProcs.h:3143

Description

Sets the default color space in a PDEContent object. The reference count on any existing default color space is decremented, and the reference count on the new color space is incremented. Note that the new color space can be NULL, indicating that there is no default color space.

See the "Default Color Spaces" section of the ISO 32000-1:2008, Document Management-Portable Document Format-Part 1: PDF 1.7, under "CIE-Based Color Spaces" in section 8.6.5.6, page 152. You can find this document on the web store of the International Standards Organization (ISO).

Syntax

void PDEContentSetDefaultColorSpace_PEWCalls_(IN PDEContent pdeContent, IN ASAtom colorSpaceName, IN PDEColorSpace colorSpace);

Parameters

pdeContent
IN A content object.
colorSpaceName
    IN An ASAtom for the name of the desired color space. It must be an ASAtom for one of the following:
  • DefaultRGB
  • DefaultCMYK
  • DefaultGray
colorSpace
IN The color space to use as the default.

PDEContentSetElemsStatus

Header: PERProcs.h:3440

Syntax

void PDEContentSetElemsStatus(IN PDEContent pdeContent, IN ASUns32 status);

PDEContentSetPage

Header: PEWProcs.h:2722

Description

Sets the page on which marked content is drawn upon for any marked content reference handles attached to containers within the content.

Note: If content is set with PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent(), this step occurs automatically.

Note: This call should only be used when the content is being directly added to a page.

Syntax

void PDEContentSetPage(IN PDEContent pdeContent, IN CosObj pageObj);

Parameters

pdeContent
The content stream whose marked content reference handles should be updated.
pageObj
The page object upon which contents are drawn.

PDEContentSetStreamOwner

Header: PEWProcs.h:2759

Description

Sets the stream owner for any marked content reference handles attached to containers within the content.

Note: This call should not be used when the content is being directly added to a page.

Note: If content is set with PDPageSetPDEContent(), PDEFormSetContent(), or PDEGroupSetContent(), this step occurs automatically.

Syntax

void PDEContentSetStreamOwner(IN PDEContent pdeContent, IN CosObj streamOwner);

Parameters

pdeContent
The content stream within which to update marked content references.
streamOwner
The owner object for any references attached to the content.

PDEContentToCosObj

Header: PEWProcs.h:100

Description

This is the main method for converting a PDEContent into PDF contents and resources.

This method does not change the PDEContent object or its reference count.

The caller of this function is responsible for adding the contents and the resources returned from this method to the Page Object.

Note: Do not use this method to put a PDEContent into a PDPage. Instead, call PDPageSetPDEContent().

Syntax

void PDEContentToCosObj(IN PDEContent pdeContent, IN ASUns32 flags, /* kPDEContentToPage, kPDEContentToForm, kPDEToContentCharProc */ IN PDEContentAttrsP attrs, IN ASUns32 attrsSize, IN CosDoc cosDoc, IN PDEFilterArrayP filtersP, OUT CosObj *contentsP, OUT CosObj *resourcesP);

Parameters

pdeContent
IN/OUT A content object.
flags
IN/OUT Flags specifying the type of object to create (page contents, form, or charproc) and how it is created. It must be one or more of PDEContentToCosObjFlags.
attrs
IN/OUT A pointer to a PDEContentAttrs structure that contains the appropriate form attributes or cache device/char-width attributes, and so on. If it is zero, no attributes are set.
attrsSize
IN/OUT The size of the attrs buffer in bytes. Zero if attrs is zero.
cosDoc
IN/OUT The document in which the contents and resources are created.
filtersP
IN/OUT A pointer to a PDEFilterArray structure that specifies which filters to use in encoding the contents; it may be NULL. If filtersP contains any encodeParms, they must belong to cosDoc.
contentsP
IN/OUT (Filled by the method) The Cos object for the resulting contents in pdeContent.
resourcesP
IN/OUT (Filled by the method) The Cos object for the resulting resources in pdeContent. Note that the client is responsible for putting the resourcesP dictionary into the contentsP stream for non-page objects. The client must do this for XObject Forms and appearance dictionaries in annotations. For Type 3 fonts, the resource dictionaries must be merged and put into the Type 3 font dictionary. For a page, the contents and resources must be put into the page object.

Exceptions