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
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.
 _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: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef struct _t_PDGraphic* PDGraphic;

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

See Also


File: PDExpT.h
Line: 2407
PDGraphicEnumMonitor 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef _t_PDGraphicEnumMonitor PDGraphicEnumMonitor;

File: PDExpT.h
Line: 2793
PDGraphicEnumMonitorRec 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef _t_PDGraphicEnumMonitor PDGraphicEnumMonitorRec;

File: PDExpT.h
Line: 2849
PDGraphicEnumParams 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef _t_PDGraphicEnumParams PDGraphicEnumParams;

File: PDExpT.h
Line: 6383
PDGraphicEnumParamsRec 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef _t_PDGraphicEnumParams PDGraphicEnumParamsRec;

File: PDExpT.h
Line: 6383
PDGraphicState 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef _t_PDGraphicState PDGraphicState;

File: PDExpT.h
Line: 2516
PDGraphicStateP 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef _t_PDGraphicState PDGraphicStateP;

File: PDExpT.h
Line: 2516


Structure Detail
_t_PDGraphicEnumMonitor
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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

Note

PDPageEnumContents is provided only for backwards compatibility. It has not been updated beyond PDF Version 1.1 and may not work correctly for newly-created PDF 1.2 or later files. You should use the PDFEdit API to enumerate page contents.
In versions at least through Acrobat 2.1, enumeration does not stop even if a method returns false.

File: PDExpT.h
Line: 2815

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: PDFL
Platform availability: Macintosh, Windows, UNIX

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

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: PDFL
Platform availability: Macintosh, Windows, UNIX

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

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: PDFL
Platform availability: Macintosh, Windows, UNIX

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: 2776
PDGraphicEnumCharWidthProc 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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: 2764
PDGraphicEnumImageProc 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

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

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

See Also


File: PDExpT.h
Line: 2714
PDGraphicEnumPathProc 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

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

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

See Also


File: PDExpT.h
Line: 2702
PDGraphicEnumRestoreProc 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool (*PDGraphicEnumRestoreProc)(void *clientData)

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

See Also


File: PDExpT.h
Line: 2753
PDGraphicEnumSaveProc 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool (*PDGraphicEnumSaveProc)(void *clientData)

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

See Also


File: PDExpT.h
Line: 2742
PDGraphicEnumTextProc 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

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

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

See Also


File: PDExpT.h
Line: 2690
PDGraphicEnumXObjectRefMatrixProc 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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: 2791
PDGraphicEnumXObjectRefProc 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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

Method Detail
PDGraphicGetBBox()
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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: 3561
PDGraphicGetCurrentMatrix() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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: 3573
PDGraphicGetState() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

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