LayerPDFEdit_Layer
ObjectPDEExtGState

A PDEExtGState object is a reference to an ExtGState resource used on a page. It specifies a PDEElement object's extended graphics state, which is part of its graphics state, as specified in a PDEGraphicState structure. See Section 4.3.4 in the PDF Reference for information on extended graphics states.

The graphics state controls the various style properties of the text including color, weight, and so forth, as shown in the following example:

memset (&gState, 0, sizeof(PDEGraphicState));

gState.strokeColorSpec.space = gState.fillColorSpec.space = pdeColorSpace;

gState.miterLimit = fixedTen;

gState.flatness = fixedOne;

gState.lineWidth = fixedOne;

gState.extGState = pdeExtGState;

gState.wasSetFlags = kPDEMiterLimitWasSet | kPDEFlatnessWasSet | kPDELineWidthWasSet | kPDEExtGStateWasSet;

You can get or set the graphics state associated with a PDEElement or PDEText object with the PDEElementGetGState() or PDEElementSetGState methods().

Setting the Opacity of an Object

With Acrobat 5.0 and PDF 1.4 and later, every object has an opacity property (default is opaque) in the extended graphics state. The code snippet below shows how to add the opacity property to either existing or new elements:

DURING

pdeExtGState = PDEExtGStateCreateNew (PDDocGetCosDoc(pdDoc));

PDEExtGStateSetOpacityFill (pdeExtGState, FloatToFixed(0.5));

PDEExtGStateSetOpacityStroke (pdeExtGState, FloatToFixed(0.5));

HANDLER

if (pdeExtGState) {

PDERelease ((PDEObject) pdeExtGState);

pdeExtGState = NULL;

}

END_HANDLER

For information on transparency, see Chapter 7 in the the PDF Reference.



Typedef Summary
 Typedef
 PDEExtGState
A reference to an ExtGState resource used on a page in a PDF file. It specifies a PDEElement object's extended graphics state, which is part of its graphics state.
Method Summary
 Method
 
PDESoftMask PDEExtGStateAcquireSoftMask(INPDEExtGState pdeExtGState)
Acquires the soft mask of the extended graphic state.
 
PDEExtGState PDEExtGStateCreate(INCosObj* cosObjP)
Creates a new PDEExtGState from a Cos object. See Section 4.3.4 in the PDF Reference for more information about extended graphics states.
 
PDEExtGState PDEExtGStateCreateNew(INCosDoc cosDoc)
Creates a new extended graphics state object.
 
ASBool PDEExtGStateGetAIS(INPDEExtGState pdeExtGState)
Returns the value of the Alpha Is Shape (AIS) member of the graphics state. If AIS is true, the sources of alpha are treated as shape; otherwise they are treated as opacity values. If the value is not set, the default value of false is returned.
 
ASAtom PDEExtGStateGetBlendMode(INPDEExtGState pdeExtGState)
Returns the blend mode for the color composite for each object painted. The following are valid names:
 
Returns the value of black point compensation. Valid names are ON, OFF and Default. If the value has not been set a value of Default is returned.
 
void PDEExtGStateGetCosObj(INPDEExtGState extGState, OUTCosObj* cosObjP)
Gets a Cos object for a PDEExtGState.
 
Returns HalfTone Co-ordinate point.
 
Returns the opacity value for painting operations other than stroking.
 
Returns the opacity value for stroke painting operations for paths and glyph outlines.
 
ASBool PDEExtGStateGetOPFill(INPDEExtGState pdeExtGState)
Returns whether overprint is enabled for painting operations other than stroking.
 
ASInt32 PDEExtGStateGetOPM(INPDEExtGState pdeExtGState)
Returns the overprint mode used by this graphics state.
 
ASBool PDEExtGStateGetOPStroke(INPDEExtGState pdeExtGState)
Returns whether overprint is enabled for stroke painting operations.
 
ASBool PDEExtGStateGetSA(INPDEExtGState pdeExtGState)
Returns whether stroke adjustment is enabled in the graphics state.
 
Gets the softmask matrix from ExtGstate.
 
ASBool PDEExtGStateGetTK(INPDEExtGState pdeExtGState)
Returns whether text knockout is enabled in the graphics state.
 
ASBool PDEExtGStateHasSoftMask(INPDEExtGState pdeExtGState)
Returns whether the graphics state contains a soft mask.
 
void PDEExtGStateSetAIS(INPDEExtGState pdeExtGState, INASBool alphaIsShape)
Specifies if the alpha is to be interpreted as a shape or opacity mask.
 
void PDEExtGStateSetBlendMode(INPDEExtGState pdeExtGState, INASAtom blendMode)
Sets the blend mode for the color composites for each object painted.
 
Sets the black point compensation. Valid names are ON, OFF and Default. An exception will be raised if the name is invalid.
 
Sets HalfTone Co-ordinate point.
 
void PDEExtGStateSetOpacityFill(INPDEExtGState pdeExtGState, INASFixed opacity)
Sets the opacity value for painting operations other than stroking. The value must be in the range from 0 to 1 inclusive. It corresponds to the / ca key within the ExtGState's dictionary. The value from 0 to 1 refers to a float number (not an ASFixed value) that should be converted to ASFixed using FloatToASFixed().
 
void PDEExtGStateSetOpacityStroke(INPDEExtGState pdeExtGState, INASFixed opacity)
Sets the opacity value for stroke operations. The value must be in the range from 0 to 1 inclusive. It corresponds to the / CA key within the ExtGState's dictionary. The value from 0 to 1 refers to a float number (not an ASFixed value) that should be converted to ASFixed using FloatToASFixed().
 
void PDEExtGStateSetOPFill(INPDEExtGState pdeExtGState, INASBool overprint)
Specifies if overprint is enabled for painting operations other than stroking. It corresponds to the / op key within the ExtGState's dictionary.
 
void PDEExtGStateSetOPM(INPDEExtGState pdeExtGState, INASInt32 opm)
Sets the overprint mode. It corresponds to the / OPM key within the ExtGState's dictionary.
 
void PDEExtGStateSetOPStroke(INPDEExtGState pdeExtGState, INASBool overprint)
Specifies if overprint is enabled for stroke operations. It corresponds to the / OP key within the ExtGState's dictionary.
 
void PDEExtGStateSetSA(INPDEExtGState pdeExtGState, INASBool strokeAdjust)
Specifies whether stroke adjustment is enabled in the graphics state.
 
void PDEExtGStateSetSoftMask(INPDEExtGState pdeExtGState, INPDESoftMask pdeSoftMask)
Sets the soft mask of the extended graphics state.
 
Sets the softmask matrix in ExtGstate.
 
void PDEExtGStateSetTK(INPDEExtGState pdeExtGState, INASBool bk)
Specifies whether text knockout is enabled in the graphics state. This corresponds to the / TK key in the ExtGState's dictionary.

Typedefs Detail
PDEExtGState 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef struct _t_PDEExtGState* PDEExtGState;

A reference to an ExtGState resource used on a page in a PDF file. It specifies a PDEElement object's extended graphics state, which is part of its graphics state.

See Also

Examples

go to source arrow PDEExtGState pdeExtGState = NULL;

File: PEExpT.h
Line: 347



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

Syntax

PDESoftMask PDEExtGStateAcquireSoftMask(INPDEExtGState pdeExtGState)

Acquires the soft mask of the extended graphic state.

Call PDERelease() to dispose of the PDESoftMask when finished with it.

Parameters

pdeExtGState — 

The extended graphics state object.

Returns

The soft mask or NULL if the ExtGState dictionary does not contain the SMask key.

Exceptions

peErrWrongPDEObjectType if pdeExtGState is NULL or is not of type
kPDEExtGState.

Since


File: PERProcs.h
Line: 2396
PDEExtGStateCreate() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEExtGState PDEExtGStateCreate(INCosObj* cosObjP)

Creates a new PDEExtGState from a Cos object. See Section 4.3.4 in the PDF Reference for more information about extended graphics states.

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

Parameters

cosObjP — 

A Cos object for a dictionary of type ExtGState.

Returns

The PDEExtGState for cosObjP.

See Also

Since


File: PEWProcs.h
Line: 1228
PDEExtGStateCreateNew() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

PDEExtGState PDEExtGStateCreateNew(INCosDoc cosDoc)

Creates a new extended graphics state object.

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

Parameters

cosDoc — 

IN/OUT The document within which the object will be used.

Returns

The newly created object.

Since

Examples

go to source arrow pdeExtGState = PDEExtGStateCreateNew(PDDocGetCosDoc(pdDoc));

File: PEWProcs.h
Line: 2030
PDEExtGStateGetAIS() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDEExtGStateGetAIS(INPDEExtGState pdeExtGState)

Returns the value of the Alpha Is Shape (AIS) member of the graphics state. If AIS is true, the sources of alpha are treated as shape; otherwise they are treated as opacity values. If the value is not set, the default value of false is returned.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

See above.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2368
PDEExtGStateGetBlendMode() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASAtom PDEExtGStateGetBlendMode(INPDEExtGState pdeExtGState)

Returns the blend mode for the color composite for each object painted. The following are valid names:

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

If the value has not been set, a value of Compatible is returned. See above.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2352
PDEExtGStateGetBPC() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASAtom PDEExtGStateGetBPC(INPDEExtGState extGS)

Returns the value of black point compensation. Valid names are ON, OFF and Default. If the value has not been set a value of Default is returned.

Parameters

extGS — 

The extended graphics state object.

Returns

ASAtom for BPC value.

See Also

Exceptions

genErrBadParm

Since


File: PERProcs.h
Line: 3710
PDEExtGStateGetCosObj() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateGetCosObj(INPDEExtGState extGState, OUTCosObj* cosObjP)

Gets a Cos object for a PDEExtGState.

Parameters

extGState — 

IN/OUT A PDEExtGState whose Cos object is obtained.

 
cosObjP — 

IN/OUT (Filled by the method) The Cos object for extGState.

See Also

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 1463
PDEExtGStateGetHalfToneOrigin() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASRealPoint PDEExtGStateGetHalfToneOrigin(INPDEExtGState extGS)

Returns HalfTone Co-ordinate point.

Parameters

extGS — 

The extended graphics state object.

Returns

ASRealPoint* for x,y coordinate value of HalfToneOrigin.

See Also

PDEExtGStateGetHalfToneOrigin

Exceptions

genErrBadParm

Since


File: PERProcs.h
Line: 3549
PDEExtGStateGetOpacityFill() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASFixed PDEExtGStateGetOpacityFill(INPDEExtGState pdeExtGState)

Returns the opacity value for painting operations other than stroking.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

Returns the value of the / ca key in the ExtGState dictionary. If the value is not found, the default value of 1 is returned.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2303
PDEExtGStateGetOpacityStroke() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASFixed PDEExtGStateGetOpacityStroke(INPDEExtGState pdeExtGState)

Returns the opacity value for stroke painting operations for paths and glyph outlines.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

Returns the value of the / CA key in the ExtGState dictionary. If the value is not found, the default value of 1 is returned.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2318
PDEExtGStateGetOPFill() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDEExtGStateGetOPFill(INPDEExtGState pdeExtGState)

Returns whether overprint is enabled for painting operations other than stroking.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

Returns the value of the / op key in the ExtGState dictionary. If the value is not found, the default value of false is returned.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2273
PDEExtGStateGetOPM() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASInt32 PDEExtGStateGetOPM(INPDEExtGState pdeExtGState)

Returns the overprint mode used by this graphics state.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

The Cos integer value.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2258
PDEExtGStateGetOPStroke() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDEExtGStateGetOPStroke(INPDEExtGState pdeExtGState)

Returns whether overprint is enabled for stroke painting operations.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

Returns the value of the / OP key in the ExtGState dictionary. If the value is not found, the default value of false is returned.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2288
PDEExtGStateGetSA() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDEExtGStateGetSA(INPDEExtGState pdeExtGState)

Returns whether stroke adjustment is enabled in the graphics state.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

Returns the value of the / SA key in the ExtGState dictionary. If the value is not set, the default value of false is returned.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2534
PDEExtGStateGetSoftMaskMatrix() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDEExtGStateGetSoftMaskMatrix(INPDEExtGState extGS, OUTASDoubleMatrixP matrixP)

Gets the softmask matrix from ExtGstate.

Parameters

extGS — 

IN A ExtGstate object.

 
matrixP — 

OUT A pointer to ASDoubleMatrix

Returns

true if the valid Soft Mask Matrix is present, false otherwise.

See Also

Since


File: PERProcs.h
Line: 3736
PDEExtGStateGetTK() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDEExtGStateGetTK(INPDEExtGState pdeExtGState)

Returns whether text knockout is enabled in the graphics state.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

Returns the value of the / TK key in the ExtGState dictionary. If the value is not found, the default value of true is returned.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2484
PDEExtGStateHasSoftMask() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool PDEExtGStateHasSoftMask(INPDEExtGState pdeExtGState)

Returns whether the graphics state contains a soft mask.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

Returns

Returns true if the ExtGState dictionary contains the / SMask key; otherwise false is returned.

Exceptions

peErrWrongPDEObjectType

Since


File: PERProcs.h
Line: 2382
PDEExtGStateSetAIS() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetAIS(INPDEExtGState pdeExtGState, INASBool alphaIsShape)

Specifies if the alpha is to be interpreted as a shape or opacity mask.

Parameters

pdeExtGState — 

The extended graphics state object.

 
alphaIsShape — 

Indicates whether the sources of alpha are to be treated as shape (true) or opacity (false). This determines the interpretation of the constant alpha (ca or CA) and soft mask (SMask) parameters of the graphics state, as well as a soft-mask image (Smask entry) of an image XObject.

Since


File: PEWProcs.h
Line: 2159
PDEExtGStateSetBlendMode() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetBlendMode(INPDEExtGState pdeExtGState, INASAtom blendMode)

Sets the blend mode for the color composites for each object painted.

The following mode names are valid:

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

 
blendMode — 

IN/OUT The new blend mode.

Since


File: PEWProcs.h
Line: 2142
PDEExtGStateSetBPC() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetBPC(INPDEExtGState extGS, INASAtom BPC)

Sets the black point compensation. Valid names are ON, OFF and Default. An exception will be raised if the name is invalid.

Parameters

extGS — 

The extended graphics state object.

 
BPC — 

New value for BPC

See Also

Exceptions

genErrBadParm

Since


File: PEWProcs.h
Line: 4288
PDEExtGStateSetHalfToneOrigin() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetHalfToneOrigin(INPDEExtGState extGS, INASRealPoint hto_point)

Sets HalfTone Co-ordinate point.

Parameters

extGS — 

The extended graphics state object.

 
hto_point — 

ASRealPoint* for x,y coordinate value of HalfToneOrigin.

See Also

PDEExtGStateSetHalfToneOrigin

Exceptions

genErrBadParm

Since


File: PEWProcs.h
Line: 4185
PDEExtGStateSetOpacityFill() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetOpacityFill(INPDEExtGState pdeExtGState, INASFixed opacity)

Sets the opacity value for painting operations other than stroking. The value must be in the range from 0 to 1 inclusive. It corresponds to the / ca key within the ExtGState's dictionary. The value from 0 to 1 refers to a float number (not an ASFixed value) that should be converted to ASFixed using FloatToASFixed().

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

 
opacity — 

IN/OUT The new opacity value.

Since

Examples

go to source arrow PDEExtGStateSetOpacityFill(pdeExtGState, FloatToASFixed(mOpacity));

File: PEWProcs.h
Line: 2090
PDEExtGStateSetOpacityStroke() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetOpacityStroke(INPDEExtGState pdeExtGState, INASFixed opacity)

Sets the opacity value for stroke operations. The value must be in the range from 0 to 1 inclusive. It corresponds to the / CA key within the ExtGState's dictionary. The value from 0 to 1 refers to a float number (not an ASFixed value) that should be converted to ASFixed using FloatToASFixed().

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

 
opacity — 

IN/OUT The new opacity value.

Since

Examples

go to source arrow PDEExtGStateSetOpacityStroke(pdeExtGState, FloatToASFixed(mOpacity));

File: PEWProcs.h
Line: 2107
PDEExtGStateSetOPFill() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetOPFill(INPDEExtGState pdeExtGState, INASBool overprint)

Specifies if overprint is enabled for painting operations other than stroking. It corresponds to the / op key within the ExtGState's dictionary.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

 
overprint — 

IN/OUT Pass true to enable overprint, false to disable overprint.

Since


File: PEWProcs.h
Line: 2058
PDEExtGStateSetOPM() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetOPM(INPDEExtGState pdeExtGState, INASInt32 opm)

Sets the overprint mode. It corresponds to the / OPM key within the ExtGState's dictionary.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

 
opm — 

IN/OUT Overprint mode.

Since


File: PEWProcs.h
Line: 2043
PDEExtGStateSetOPStroke() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetOPStroke(INPDEExtGState pdeExtGState, INASBool overprint)

Specifies if overprint is enabled for stroke operations. It corresponds to the / OP key within the ExtGState's dictionary.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

 
overprint — 

IN/OUT Pass true to enable overprint, false to disable overprint.

Since


File: PEWProcs.h
Line: 2073
PDEExtGStateSetSA() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetSA(INPDEExtGState pdeExtGState, INASBool strokeAdjust)

Specifies whether stroke adjustment is enabled in the graphics state.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

 
strokeAdjust — 

IN/OUT Pass true to enable stroke adjustment, false to disable stroke adjustment.

Exceptions

peErrWrongPDEObjectType

Since


File: PEWProcs.h
Line: 2479
PDEExtGStateSetSoftMask() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetSoftMask(INPDEExtGState pdeExtGState, INPDESoftMask pdeSoftMask)

Sets the soft mask of the extended graphics state.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

 
pdeSoftMask — 

IN/OUT The soft mask object.

Since


File: PEWProcs.h
Line: 2171
PDEExtGStateSetSoftMaskMatrix() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetSoftMaskMatrix(INPDEExtGState extGS, INASDoubleMatrixP matrixP)

Sets the softmask matrix in ExtGstate.

Parameters

extGS — 

IN A ExtGstate object.

 
matrixP — 

IN A pointer to ASDoubleMatrix

See Also

Since


File: PEWProcs.h
Line: 4324
PDEExtGStateSetTK() 
Product availability: PDFL
Platform availability: Macintosh, Windows, UNIX

Syntax

void PDEExtGStateSetTK(INPDEExtGState pdeExtGState, INASBool bk)

Specifies whether text knockout is enabled in the graphics state. This corresponds to the / TK key in the ExtGState's dictionary.

Parameters

pdeExtGState — 

IN/OUT The extended graphics state object.

 
bk — 

IN/OUT Pass true to enable text knockout, false to disable text knockout.

Since


File: PEWProcs.h
Line: 2284