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. |
kPDEGetFonts | Obtain font resources.
|
kPDEGetXObjects | Obtain Xobject resources.
|
kPDEGetColorSpaces | Obtain color space resources.
|
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).
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
|
setcachedevice
parameters. typedef
struct
_t_PDEContent
*
PDEContent
;
| |
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. | |
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.
| |
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.
| |
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.
| |
|
Note: This method increments the reference count of pdeElement
.
void
PDEContentAddElem(
IN
PDEContent
pdeContent
,
IN
ASInt32
addAfterIndex
,
IN
PDEElement
pdeElement
);
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. |
0
, which indicates the object is to be appended to the content. 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
);
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 | |||||||
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:
| ||||||
bbox |
0
, which indicates the object is to be appended to the content. 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
);
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 | |||||||
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:
| ||||||
bbox |
void
PDEContentCopyResTable(
PDEContent
src
,
PDEContent
dst
);
path | IN The PDEContent whose ResTable data is to be copied.
|
data | IN/OUT Destination PDEContent whose ResTable data is to be updated.
|
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().
PDEContent
PDEContentCreate(
void
);
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.
PDEContent
PDEContentCreateFromCosObj(
const
CosObj
*
contents
,
const
CosObj
*
resources
);
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. |
ASBool
PDEContentFlattenOC(
PDEContent
content
,
PDOCContext
context
);
content | The content to be modified.
|
context | The optional-content context in which
content is checked for visibility. |
void
PDEContentGetAttrs(
IN
PDEContent
pdeContent
,
OUT
PDEContentAttrsP
attrsP
,
IN
ASUns32
attrsSize
);
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. |
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.
PDEColorSpace
PDEContentGetDefaultColorSpace(
IN
PDEContent
pdeContent
,
IN
ASAtom
colorSpaceName
);
pdeContent | IN/OUT A content object.
|
colorSpaceName |
pdeContent
. It returns NULL
if colorSpaceName
does not correspond to a known default, such as DefaultRGB. Note: This method does not change the reference count of the element.
Note: This method does not copy the element.
PDEElement
PDEContentGetElem(
IN
PDEContent
pdeContent
,
IN
ASInt32
index
);
pdeContent | IN/OUT A content object.
|
index | IN/OUT The index of element to obtain.
|
ASUns32
PDEContentGetElemsStatus(
IN
PDEContent
pdeContent
);
ASInt32
PDEContentGetNumElems(
IN
PDEContent
pdeContent
);
pdeContent | IN/OUT A content object.
|
pdeContent
. ASInt32
PDEContentGetResources(
IN
PDEContent
pdeContent
,
IN
ASInt32
type
,
OUT
PDEObject
*
resourcesP
);
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 . |
type
returned in resourcesP
. Note: This decrements the reference count of the element removed.
void
PDEContentRemoveElem(
IN
PDEContent
pdeContent
,
IN
ASInt32
index
);
pdeContent | IN/OUT A content object.
|
index | IN/OUT The index in
pdeContent of the element to remove whose reference count is decremented. |
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.
void
PDEContentSetContainingStream(
IN
PDEContent
pdeContent
,
IN
CosObj
containingStm
);
pdeContent | The content stream within which to update marked content references.
|
containingStm | The containing stream object for the content stream.
|
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).
void
PDEContentSetDefaultColorSpace_PEWCalls_(
IN
PDEContent
pdeContent
,
IN
ASAtom
colorSpaceName
,
IN
PDEColorSpace
colorSpace
);
pdeContent | IN A content object.
|
colorSpaceName | |
colorSpace | IN The color space to use as the default.
|
void
PDEContentSetElemsStatus(
IN
PDEContent
pdeContent
,
IN
ASUns32
status
);
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.
void
PDEContentSetPage(
IN
PDEContent
pdeContent
,
IN
CosObj
pageObj
);
pdeContent | The content stream whose marked content reference handles should be updated.
|
pageObj | The page object upon which contents are drawn.
|
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.
void
PDEContentSetStreamOwner(
IN
PDEContent
pdeContent
,
IN
CosObj
streamOwner
);
pdeContent | The content stream within which to update marked content references.
|
streamOwner | The owner object for any references attached to the content.
|
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().
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
);
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. |