Layer | PDFEdit_Layer |
Object | PDEContent |
The PDEContent object is the workhorse of the PDFEdit API, since it contains the modifiable contents of a PDPage.
A PDEContent may be obtained from an existing page or from a form XObject or from a Type 3 charproc. You can create an empty PDEContent. A PDEContent contains PDEElement objects. In addition, a PDEContent may have attributes such as Form matrix and setcachedevice parameters.
The simplest way to obtain the PDEContent for a page is with the PDPageAcquirePDEContent() method. After your plug-in modifies the content, it can put it back in the page with PDPageSetPDEContent(), using the same filters with which the page was originally encoded.
Once your plug-in has the page's PDEContent, it can get, add, or remove elements with PDEContent methods. It can modify individual page elements with the methods for PDEElement objects such as PDEText or PDEPath.
Typedef | ||
---|---|---|
PDEContent
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.
|
||
PDEContentAttrs | ||
PDEContentAttrsP |
Enumeration | ||
---|---|---|
PDEContentFlags
A bit field for PDEContentAttrs.
|
||
PDEContentGetResourceFlags
A bit field for PDEContentAttrs.
|
||
PDEContentToCosObjFlags
A bit field for the PDEContentToCosObj() method, indicating the type of object to create and how it is created.
|
Structure | ||
---|---|---|
_t_PDEContentAttrs
A structure describing attributes of a PDEContent object.
|
Method | ||
---|---|---|
Inserts an element into a PDEContent.
|
||
void PDEContentAddPage(OUTPDEContent theContent, INASInt32 insertAfterIndex, INCosDoc containerDoc, INPDPage srcPage, INASFixedMatrix* dstMatrix, INASAtom annotTypes, INASInt32 flags, INASFixedRect* bbox)
Superseded by PDEContentAddPageEx() in Acrobat 10.0.
|
||
void PDEContentAddPageEx(OUTPDEContent theContent, INASInt32 insertAfterIndex, INCosDoc containerDoc, INPDPage srcPage, INASDoubleMatrix* dstMatrix, INASAtom annotTypes, INASInt32 flags, INASDoubleRect* bbox)
Supersedes PDEContentAddPage() in Acrobat 10.0.
|
||
PDEContent PDEContentCreate()
Creates an empty content object.
|
||
Creates a content object from a Cos object. This is the main method for obtaining a PDEContent object.
|
||
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.
|
||
Gets the attributes of a content.
|
||
Gets a default color space from a PDEContent object.
|
||
Gets the requested element from a content.
|
||
ASInt32 PDEContentGetNumElems(INPDEContent pdeContent)
Gets the number of elements in a PDEContent object.
|
||
Gets the number of resources of the specified type and, optionally, gets the pointers to the resource objects.
|
||
Removes an element from a PDEContent.
|
||
Sets the containing stream and owner stream for any marked content reference handles attached to containers within the content.
|
||
void PDEContentSetDefaultColorSpace_PEWCalls_(INPDEContent pdeContent, INASAtom colorSpaceName, INPDEColorSpace colorSpace)
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.
|
||
Sets the page on which marked content is drawn upon for any marked content reference handles attached to containers within the content.
|
||
Sets the stream owner for any marked content reference handles attached to containers within the content.
|
||
void PDEContentToCosObj(INPDEContent pdeContent, INASUns32 flags, INPDEContentAttrsP attrs, INASUns32 attrsSize, INCosDoc cosDoc, INPDEFilterArrayP filtersP, OUTCosObj* contentsP, OUTCosObj* resourcesP)
This is the main method for converting a PDEContent into PDF contents and resources.
|
PDEContent |
Product availability: All |
Platform availability: All |
typedef struct _t_PDEContent* PDEContent;
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.
See Also
File: PEExpT.h |
Line: 119 |
PDEContentAttrs |
Product availability: All |
Platform availability: All |
typedef _t_PDEContentAttrs PDEContentAttrs;
File: PEExpT.h |
Line: 497 |
PDEContentAttrsP |
Product availability: All |
Platform availability: All |
typedef _t_PDEContentAttrs PDEContentAttrsP;
File: PEExpT.h |
Line: 497 |
PDEContentFlags |
Product availability: All |
Platform availability: All |
enum PDEContentFlags {
kPDESetCacheDevice = 0x0001,
kPDESetCharWidth = 0x0002,
kPDEFormMatrix = 0x0004
}
See Also
File: PEExpT.h |
Line: 1522 |
kPDESetCacheDevice | If set, |
|
kPDESetCharWidth | If set, |
|
kPDEFormMatrix | If set, |
PDEContentGetResourceFlags |
Product availability: All |
Platform availability: All |
enum PDEContentGetResourceFlags {
kPDEGetFonts,
kPDEGetXObjects,
kPDEGetColorSpaces
}
See Also
File: PEExpT.h |
Line: 1503 |
kPDEGetFonts | Obtain font resources. |
|
kPDEGetXObjects | Obtain Xobject resources. |
|
kPDEGetColorSpaces |
PDEContentToCosObjFlags |
Product availability: All |
Platform availability: All |
enum PDEContentToCosObjFlags {
kPDEContentToPage = 0x0001,
kPDEContentToForm = 0x0002,
kPDEContentToCharProc = 0x0004,
kPDEContentRev1Compat = 0x0008,
kPDEContentDoNotResolveForms = 0x0010,
kPDEContentDoNotResolveType3 = 0x0020,
kPDEContentEmitDefaultRGBAndGray = 0x0040,
kPDEContentInheritState = 0x0080,
kPDEContentDoNotEmitBXEX = 0x0100,
kPDEContentUseMaxPrecision = 0x0200,
kPDEContentUseSpaceAsEOL = 0x0400,
kPDEContentHonorWasSetFlags = 0x0800
}
See Also
File: PEExpT.h |
Line: 1438 |
kPDEContentToPage | Create page contents. |
|
kPDEContentToForm | Create a form. |
|
kPDEContentToCharProc | Create charprocs. |
|
kPDEContentRev1Compat | Currently unused. |
|
kPDEContentDoNotResolveForms | Currently unused. |
|
kPDEContentDoNotResolveType3 | Currently unused. |
|
kPDEContentEmitDefaultRGBAndGray | 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, as described in Section 4.5.7 in the PDF Reference. |
|
kPDEContentDoNotEmitBXEX | Prevents the emission of the content compatibility operators, BX/EX, which cause issues for some versions of PDF/A or PDF/X. |
|
kPDEContentUseSpaceAsEOL | Use a space character as the EOL character in the content stream to make the Flate compressor more effective. |
|
kPDEContentHonorWasSetFlags | Emit a gstate or textstate parameter for any element, only if the corresponding WasSetFlag is set. Settting this flag will skip setting the bounding box of form XObject. |
_t_PDEContentAttrs |
Product availability: All |
Platform availability: All |
struct _t_PDEContentAttrs {
ASUns32 flags;
ASFixed cacheDevice[8];
ASInt32 formType;
ASFixedRect bbox;
ASFixedMatrix matrix;
CosObj XUID;
}
A structure describing attributes of a PDEContent object.
See Also
File: PEExpT.h |
Line: 458 |
flags | ||
cacheDevice | If flags has kPDESetCacheDevice set, the first six cache device values contain the operands for the d1 ( |
|
formType | Only used if PDEContent contains a Form XObject. It corresponds to FormType key in the XObject Form attributes dictionary. |
|
bbox | 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. |
|
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. |
|
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. |
PDEContentAddElem | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentAddElem(INPDEContent pdeContent, INASInt32 addAfterIndex, INPDEElement pdeElement)
Inserts an element into a PDEContent.
Parameters
pdeContent — | The content to which |
|
addAfterIndex — | The location after which |
|
pdeElement — | The element to add to |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 149 |
PDEContentAddPage | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentAddPage(OUTPDEContent theContent, INASInt32 insertAfterIndex, INCosDoc containerDoc, INPDPage srcPage, INASFixedMatrix* dstMatrix, INASAtom annotTypes, INASInt32 flags, INASFixedRect* bbox)
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.
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 — | ||
srcPage — | The page that will be inserted at |
|
dstMatrix — | (May be |
|
annotTypes — | If the page contains annotations, the |
|
flags — | (May be |
|
bbox — | (May be |
See Also
Since
File: PEWProcs.h |
Line: 1777 |
PDEContentAddPageEx | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentAddPageEx(OUTPDEContent theContent, INASInt32 insertAfterIndex, INCosDoc containerDoc, INPDPage srcPage, INASDoubleMatrix* dstMatrix, INASAtom annotTypes, INASInt32 flags, INASDoubleRect* bbox)
Supersedes PDEContentAddPage() 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.
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 — | ||
srcPage — | The page that will be inserted at |
|
dstMatrix — | (May be |
|
annotTypes — | If the page contains annotations, the |
|
flags — | (May be |
|
bbox — | (May be |
See Also
Since
File: PEWProcs.h |
Line: 3639 |
PDEContentCreate | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
PDEContent PDEContentCreate()
Creates an empty content object.
Call PDERelease() to dispose of the returned content object when finished with it.
ReturnsAn empty content object. |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 49 |
PDEContentCreateFromCosObj | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
PDEContent PDEContentCreateFromCosObj(const CosObj* contents, const CosObj* resources)
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.
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 |
The content from the Cos object. |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 111 |
PDEContentFlattenOC | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASBool PDEContentFlattenOC(PDEContent content, PDOCContext context)
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.
Parameters
content — | The content to be modified. |
|
context — | The optional-content context in which |
|
See Also
File: PEWProcs.h |
Line: 2570 |
PDEContentGetAttrs | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentGetAttrs(INPDEContent pdeContent, OUTPDEContentAttrsP attrsP, INASUns32 attrsSize)
Gets the attributes of a content.
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 — |
Exceptions
Since
File: PERProcs.h |
Line: 126 |
PDEContentGetDefaultColorSpace | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
PDEColorSpace PDEContentGetDefaultColorSpace(INPDEContent pdeContent, INASAtom colorSpaceName)
Gets a default color space from a PDEContent object.
See Section 4.5.4 in the PDF Reference for more information about default color spaces.
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. |
The desired color space in |
See Also
Since
File: PERProcs.h |
Line: 2018 |
PDEContentGetElem | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
PDEElement PDEContentGetElem(INPDEContent pdeContent, INASInt32 index)
Gets the requested element from a content.
Parameters
pdeContent — | IN/OUT A content object. |
|
index — | IN/OUT The index of element to obtain. |
The requested element. |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 182 |
PDEContentGetNumElems | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASInt32 PDEContentGetNumElems(INPDEContent pdeContent)
Gets the number of elements in a PDEContent object.
Parameters
pdeContent — | IN/OUT A content object. |
The number of elements in |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 163 |
PDEContentGetResources | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASInt32 PDEContentGetResources(INPDEContent pdeContent, INASInt32 type, OUTPDEObject* resourcesP)
Gets the number of resources of the specified type and, optionally, gets the pointers to the resource objects.
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- |
The number of resources of |
Exceptions
Since
File: PERProcs.h |
Line: 151 |
PDEContentRemoveElem | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentRemoveElem(INPDEContent pdeContent, INASInt32 index)
Removes an element from a PDEContent.
Parameters
pdeContent — | IN/OUT A content object. |
|
index — | IN/OUT The index in |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 125 |
PDEContentSetContainingStream | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentSetContainingStream(INPDEContent pdeContent, INCosObj containingStm)
Sets the containing stream and owner stream for any marked content reference handles attached to containers within the content.
Parameters
pdeContent — | The content stream within which to update marked content references. |
|
containingStm — | The containing stream object for the content stream. |
See Also
Since
File: PEWProcs.h |
Line: 3025 |
PDEContentSetDefaultColorSpace_PEWCalls_ | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentSetDefaultColorSpace_PEWCalls_(INPDEContent pdeContent, INASAtom colorSpaceName, INPDEColorSpace colorSpace)
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 Section 4.5.4 in the PDF Reference for more information about default color spaces.
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:
|
|
colorSpace — |
Since
File: PEWProcs.h |
Line: 3478 |
PDEContentSetPage | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentSetPage(INPDEContent pdeContent, INCosObj pageObj)
Sets the page on which marked content is drawn upon for any marked content reference handles attached to containers within the content.
Parameters
pdeContent — | The content stream whose marked content reference handles should be updated. |
|
pageObj — | The page object upon which contents are drawn. |
See Also
Since
File: PEWProcs.h |
Line: 3004 |
PDEContentSetStreamOwner | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentSetStreamOwner(INPDEContent pdeContent, INCosObj streamOwner)
Sets the stream owner for any marked content reference handles attached to containers within the content.
Parameters
pdeContent — | The content stream within which to update marked content references. |
|
streamOwner — | The owner object for any references attached to the content. |
See Also
Since
File: PEWProcs.h |
Line: 3045 |
PDEContentToCosObj | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEContentToCosObj(INPDEContent pdeContent, INASUns32 flags, INPDEContentAttrsP attrs, INASUns32 attrsSize, INCosDoc cosDoc, INPDEFilterArrayP filtersP, OUTCosObj* contentsP, OUTCosObj* resourcesP)
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.
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 |
|
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 |
|
contentsP — | IN/OUT (Filled by the method) The Cos object for the resulting contents in |
|
resourcesP — | IN/OUT (Filled by the method) The Cos object for the resulting resources in |
See Also
Exceptions
Since
File: PEWProcs.h |
Line: 108 |