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:
 
void PDEExtGStateGetCosObj(INPDEExtGState extGState, OUTCosObj* cosObjP)
Gets a Cos object for a PDEExtGState.
 
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.
 
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.
 
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.
 
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: All
Platform availability: All

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


File: PEExpT.h
Line: 347



Method Detail
PDEExtGStateAcquireSoftMask()
Product availability: Acrobat, 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: 2393
PDEExtGStateCreate() 
Product availability: Acrobat, 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: 1226
PDEExtGStateCreateNew() 
Product availability: Acrobat, 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


File: PEWProcs.h
Line: 2026
PDEExtGStateGetAIS() 
Product availability: Acrobat, 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: 2365
PDEExtGStateGetBlendMode() 
Product availability: Acrobat, 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: 2349
PDEExtGStateGetCosObj() 
Product availability: Acrobat, 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: 1461
PDEExtGStateGetOpacityFill() 
Product availability: Acrobat, 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: 2300
PDEExtGStateGetOpacityStroke() 
Product availability: Acrobat, 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: 2315
PDEExtGStateGetOPFill() 
Product availability: Acrobat, 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: 2270
PDEExtGStateGetOPM() 
Product availability: Acrobat, 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: 2255
PDEExtGStateGetOPStroke() 
Product availability: Acrobat, 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: 2285
PDEExtGStateGetSA() 
Product availability: Acrobat, 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: 2531
PDEExtGStateGetTK() 
Product availability: Acrobat, 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: 2481
PDEExtGStateHasSoftMask() 
Product availability: Acrobat, 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: 2379
PDEExtGStateSetAIS() 
Product availability: Acrobat, 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: 2155
PDEExtGStateSetBlendMode() 
Product availability: Acrobat, 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: 2138
PDEExtGStateSetOpacityFill() 
Product availability: Acrobat, 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


File: PEWProcs.h
Line: 2086
PDEExtGStateSetOpacityStroke() 
Product availability: Acrobat, 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


File: PEWProcs.h
Line: 2103
PDEExtGStateSetOPFill() 
Product availability: Acrobat, 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: 2054
PDEExtGStateSetOPM() 
Product availability: Acrobat, 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: 2039
PDEExtGStateSetOPStroke() 
Product availability: Acrobat, 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: 2069
PDEExtGStateSetSA() 
Product availability: Acrobat, 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: 2471
PDEExtGStateSetSoftMask() 
Product availability: Acrobat, 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: 2167
PDEExtGStateSetTK() 
Product availability: Acrobat, 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: 2280