LayerPD_Layer
ObjectPDGraphic

PDGraphic is the abstract superclass for all graphic objects that comprise page, charproc, and PDForm descriptions (see Chapter 4, Graphics, in the PDF Reference). There are no objects of type PDGraphic, but its methods can be used by any graphic object. There are three types of graphic objects: PDPath, PDText, and PDInlineImage. In addition to these three objects, there are also operators in the content stream. These operators are: Save, Restore, references to XObjects (forms and image resources), and for Type 3 font descriptions only, charwidth and cachedevice. You can access these objects and operators via PDPageEnumContents(), PDFormEnumPaintProc(), or PDCharProcEnum().

Many of the methods provide access to parameters of the graphics state. For a discussion of the graphics state and its parameters, see Section 4.3, Graphics State, in the PDF Reference.



Typedef Summary
 Typedef
 PDGraphic
All graphic objects that comprise page, charproc, and PDForm descriptions.
 PDGraphicEnumMonitor
 PDGraphicEnumMonitorRec
 PDGraphicEnumParams
 PDGraphicEnumParamsRec
 PDGraphicState
 PDGraphicStateP
Structure Summary
 Structure
 _t_PDGraphicEnumMonitor
An array of callbacks to pass to PDCharProcEnum(), PDFormEnumPaintProc() or PDPageEnumContents(). One of the callbacks is called for every renderable object in the page contents. Pass NULL for a callback to not enumerate that type of object. Each array element must be either NULL or a valid callback. Enumeration of the page contents halts if the callback returns false.
 _t_PDGraphicEnumParams
MAC_PLATFORM || !__LP64__.
 _t_PDGraphicState
A data structure containing information about the current graphics state.
Callback Summary
 Callback
 PDGraphicEnumCacheDeviceProc
A callback for PDGraphicEnumMonitor. It is called for every d1 (setcachedevice) operator.
 PDGraphicEnumCharWidthProc
A callback for PDGraphicEnumMonitor. It is called for every d0 (setcharwidth) operator.
 PDGraphicEnumImageProc
A callback for PDGraphicEnumMonitor. It is called for every image operator.
 PDGraphicEnumPathProc
A callback for PDGraphicEnumMonitor. It is called for every path operator.
 PDGraphicEnumRestoreProc
A callback for PDGraphicEnumMonitor. It is called for every Q (restore) operator.
 PDGraphicEnumSaveProc
A callback for PDGraphicEnumMonitor. It is called for every Q (save) operator.
 PDGraphicEnumTextProc
A callback for PDGraphicEnumMonitor. It is called for every text operator.
 PDGraphicEnumXObjectRefMatrixProc
A callback for PDGraphicEnumMonitor. It gets the current matrix for the subsequent XObject. It is called immediately before PDGraphicEnumXObjectRefProc().
 PDGraphicEnumXObjectRefProc
A callback for PDGraphicEnumMonitor. It is called for every XObject (Do) operator.
Method Summary
 Method
 
Gets a bounding box for the specified graphic object.
 
Gets the current transformation matrix in effect for a graphic object; the matrix is relative to user space.
 
Gets the graphics state associated with a graphic object. See Section 4.3 in the PDF Reference for a discussion of the graphics state parameters.

Typedefs Detail
PDGraphic 
Product availability: All
Platform availability: All

Syntax

typedef struct _t_PDGraphic* PDGraphic;

All graphic objects that comprise page, charproc, and PDForm descriptions.

See Also


File: PDExpT.h
Line: 2405
PDGraphicEnumMonitor 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDGraphicEnumMonitor PDGraphicEnumMonitor;

File: PDExpT.h
Line: 2791
PDGraphicEnumMonitorRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDGraphicEnumMonitor PDGraphicEnumMonitorRec;

File: PDExpT.h
Line: 2847
PDGraphicEnumParams 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDGraphicEnumParams PDGraphicEnumParams;

File: PDExpT.h
Line: 6379
PDGraphicEnumParamsRec 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDGraphicEnumParams PDGraphicEnumParamsRec;

File: PDExpT.h
Line: 6379
PDGraphicState 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDGraphicState PDGraphicState;

File: PDExpT.h
Line: 2514
PDGraphicStateP 
Product availability: All
Platform availability: All

Syntax

typedef _t_PDGraphicState PDGraphicStateP;

File: PDExpT.h
Line: 2514


Structure Detail
_t_PDGraphicEnumMonitor
Product availability: All
Platform availability: All

Syntax

struct _t_PDGraphicEnumMonitor {
 ASSize_t size; 
 
 PDGraphicEnumTextProc EnumText; 
 
 PDGraphicEnumPathProc EnumPath; 
 
 PDGraphicEnumImageProc EnumImage; 
 
 PDGraphicEnumXObjectRefProc EnumXObjectRef; 
 
 PDGraphicEnumSaveProc EnumSave; 
 
 PDGraphicEnumRestoreProc EnumRestore; 
 
 PDGraphicEnumCharWidthProc EnumCharWidth; 
 
 PDGraphicEnumCacheDeviceProc EnumCacheDevice; 
 
 PDGraphicEnumXObjectRefMatrixProc EnumXObjectRefMatrix; 
}

An array of callbacks to pass to PDCharProcEnum(), PDFormEnumPaintProc() or PDPageEnumContents(). One of the callbacks is called for every renderable object in the page contents. Pass NULL for a callback to not enumerate that type of object. Each array element must be either NULL or a valid callback. Enumeration of the page contents halts if the callback returns false.

See Also


File: PDExpT.h
Line: 2813

Elements
size  

The size of the data structure. It must be set to sizeof(PDGraphicEnumMonitorRec).

 
EnumXObjectRefMatrix  

If non-NULL, EnumXObjectRefMatrix is called immediately before EnumXObjectRef. It returns the current matrix for the subsequent XObject ref.

_t_PDGraphicEnumParams 
Product availability: All
Platform availability: All

Syntax

struct _t_PDGraphicEnumParams {
 ASUns32 size; 
 
 PDOCContext clientOCContext; 
 
 PDOCContext usedOCContext; 
 
 PDGraphicEnumMonitor mon; 
 
 void* monObj; 
}

Enumeration parameters used for optional-content drawing control in PDFormEnumPaintProcWithParams() and PDCharProcEnumWithParams(). The parameters are the same as those passed to the original versions of these methods (PDFormEnumPaintProc() and PDCharProcEnum()), with the addition of an optional-content context that determines what contents are visible.

See Also


File: PDExpT.h
Line: 6353

Elements
size  

The size of the data structure.

 
clientOCContext  

An optional-content context that determines what contents are visible. NULL uses the document's optional-content context, as returned by PDDocGetOCContext(pddoc), which is equivalent to calling the version of the method without optional-content parameters. This context is copied and the copy is used in drawing. This allows a client to change its copy of the context without raising an exception.

 
usedOCContext  

Filled by the method with the context that will be used during enumeration. This is a copy of the context specified by clientOCContext.

 
mon  

The graphic enumeration monitor.

 
monObj  

A pointer to user-supplied data to pass to the monitor.

_t_PDGraphicState 
Product availability: All
Platform availability: All

Syntax

struct _t_PDGraphicState {
 ASFixedMatrix ctm; 
 
 ASFixed fillColor[4]; 
 
 ASFixed strokeColor[4]; 
 
 ASAtom fillCSpace; 
 
 ASAtom strokeCSpace; 
 
 ASFixed flatness; 
 
 ASInt32 lineCap; 
 
 ASFixed dashPhase; 
 
 ASTArraySize dashLen; 
 
 ASFixed dashes[10]; 
 
 ASInt32 lineJoin; 
 
 ASFixed lineWidth; 
 
 ASFixed miterLimit; 
}

A data structure containing information about the current graphics state.

See Also


File: PDExpT.h
Line: 2475

Elements
ctm  

Current transformation matrix.

 
fillColor  

Fill color.

 
strokeColor  

Stroke color.

 
fillCSpace  

Fill color space.

 
strokeCSpace  

Stroke color space.

 
flatness  

Flatness tolerance.

 
lineCap  

Line cap style.

 
dashPhase  

Dash phase.

 
dashLen  

Length of dash array.

 
dashes  

Fixed to 10. The viewer has been extended to support dashes of any length.

 
lineJoin  

Line join style.

 
lineWidth  

Line width.

 
miterLimit  

Miter limit.

Callbacks Detail
PDGraphicEnumCacheDeviceProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*PDGraphicEnumCacheDeviceProc)(ASFixed *parms, void *clientData)

A callback for PDGraphicEnumMonitor. It is called for every d1 (setcachedevice) operator.

See Also


File: PDExpT.h
Line: 2774
PDGraphicEnumCharWidthProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*PDGraphicEnumCharWidthProc)(ASFixedPoint width, void *clientData)

A callback for PDGraphicEnumMonitor. It is called for every d0 (setcharwidth) operator.

See Also


File: PDExpT.h
Line: 2762
PDGraphicEnumImageProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*PDGraphicEnumImageProc)(PDInlineImage obj, void *clientData)

A callback for PDGraphicEnumMonitor. It is called for every image operator.

See Also


File: PDExpT.h
Line: 2712
PDGraphicEnumPathProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*PDGraphicEnumPathProc)(PDPath obj, void *clientData)

A callback for PDGraphicEnumMonitor. It is called for every path operator.

See Also


File: PDExpT.h
Line: 2700
PDGraphicEnumRestoreProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*PDGraphicEnumRestoreProc)(void *clientData)

A callback for PDGraphicEnumMonitor. It is called for every Q (restore) operator.

See Also


File: PDExpT.h
Line: 2751
PDGraphicEnumSaveProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*PDGraphicEnumSaveProc)(void *clientData)

A callback for PDGraphicEnumMonitor. It is called for every Q (save) operator.

See Also


File: PDExpT.h
Line: 2740
PDGraphicEnumTextProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*PDGraphicEnumTextProc)(PDText obj, void *clientData)

A callback for PDGraphicEnumMonitor. It is called for every text operator.

See Also


File: PDExpT.h
Line: 2688
PDGraphicEnumXObjectRefMatrixProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*PDGraphicEnumXObjectRefMatrixProc)(ASFixedMatrix *matrix, void *clientData)

A callback for PDGraphicEnumMonitor. It gets the current matrix for the subsequent XObject. It is called immediately before PDGraphicEnumXObjectRefProc().

See Also


File: PDExpT.h
Line: 2789
PDGraphicEnumXObjectRefProc 
Product availability: All
Platform availability: All

Syntax

ASBool (*PDGraphicEnumXObjectRefProc)(char *name, ASFixedRect *bbox, void *clientData)

A callback for PDGraphicEnumMonitor. It is called for every XObject (Do) operator.

See Also


File: PDExpT.h
Line: 2729

Method Detail
PDGraphicGetBBox()
Product availability: All
Platform availability: All

Syntax

void PDGraphicGetBBox(PDGraphic obj, ASFixedRect* bboxP)

Gets a bounding box for the specified graphic object.

Parameters

obj — 

The graphic object whose bounding box is obtained.

 
bboxP — 

(Filled by the method) A pointer to a rectangle containing the bounding box for obj. If it is called during PDFormEnumPaintProc() or PDCharProcEnum(), the coordinates are specified in the object space, meaning that they are relative to the object's matrix.

See Also

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 3562
PDGraphicGetCurrentMatrix() 
Product availability: All
Platform availability: All

Syntax

void PDGraphicGetCurrentMatrix(PDGraphic obj, ASFixedMatrix* matrix)

Gets the current transformation matrix in effect for a graphic object; the matrix is relative to user space.

Parameters

obj — 

IN/OUT The graphic object for which transformation matrix is obtained.

 
matrix — 

IN/OUT (Filled by the method) A pointer to a matrix containing the transformation matrix for obj.

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 3574
PDGraphicGetState() 
Product availability: All
Platform availability: All

Syntax

void PDGraphicGetState(PDGraphic obj, PDGraphicStateP stateP, ASInt32 stateLen)

Gets the graphics state associated with a graphic object. See Section 4.3 in the PDF Reference for a discussion of the graphics state parameters.

Parameters

obj — 

IN/OUT The graphic object whose graphics state is obtained.

 
stateP — 

IN/OUT (Filled by the method) A pointer to a PDGraphicState structure containing the graphics state.

 
stateLen — 

IN/OUT It must be sizeof(PDGraphicsState).

Since

PI_PDMODEL_VERSION >= 0x00020000

File: PDProcs.h
Line: 3588