Layer | PDFEdit_Layer |
Object | PDEExtGState |
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 | ||
---|---|---|
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 | ||
---|---|---|
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:
|
||
Gets a Cos object for a PDEExtGState.
|
||
ASFixed PDEExtGStateGetOpacityFill(INPDEExtGState pdeExtGState)
Returns the opacity value for painting operations other than stroking.
|
||
ASFixed PDEExtGStateGetOpacityStroke(INPDEExtGState pdeExtGState)
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.
|
||
Specifies if the alpha is to be interpreted as a shape or opacity mask.
|
||
Sets the blend mode for the color composites for each object painted.
|
||
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().
|
||
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().
|
||
Specifies if overprint is enabled for painting operations other than stroking. It corresponds to the / op key within the ExtGState's dictionary.
|
||
Sets the overprint mode. It corresponds to the / OPM key within the ExtGState's dictionary.
|
||
Specifies if overprint is enabled for stroke operations. It corresponds to the / OP key within the ExtGState's dictionary.
|
||
Specifies whether stroke adjustment is enabled in the graphics state.
|
||
Sets the soft mask of the extended graphics state.
|
||
Specifies whether text knockout is enabled in the graphics state. This corresponds to the / TK key in the ExtGState's dictionary.
|
PDEExtGState |
Product availability: All |
Platform availability: All |
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 |
PDEExtGStateAcquireSoftMask | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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. |
The soft mask or |
Exceptions
Since
File: PERProcs.h |
Line: 2393 |
PDEExtGStateCreate | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — |
The PDEExtGState for |
See Also
Since
File: PEWProcs.h |
Line: 1226 |
PDEExtGStateCreateNew | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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. |
The newly created object. |
Since
File: PEWProcs.h |
Line: 2026 |
PDEExtGStateGetAIS | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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. |
See above. |
Exceptions
Since
File: PERProcs.h |
Line: 2365 |
PDEExtGStateGetBlendMode | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASAtom PDEExtGStateGetBlendMode(INPDEExtGState pdeExtGState)
Returns the blend mode for the color composite for each object painted. The following are valid names:
Compatible
Normal
Multiply
Screen
Difference
Darken
Lighten
ColorDodge
ColorBurn
Exclusion
HardLight
Overlay
SoftLight
Luminosity
Hue
Saturation
Color
Parameters
pdeExtGState — | IN/OUT The extended graphics state object. |
If the value has not been set, a value of Compatible is returned. See above. |
Exceptions
Since
File: PERProcs.h |
Line: 2349 |
PDEExtGStateGetCosObj | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
See Also
Exceptions
Since
File: PERProcs.h |
Line: 1461 |
PDEExtGStateGetOpacityFill | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASFixed PDEExtGStateGetOpacityFill(INPDEExtGState pdeExtGState)
Returns the opacity value for painting operations other than stroking.
Parameters
pdeExtGState — | IN/OUT The extended graphics state object. |
Returns the value of the / ca key in the ExtGState dictionary. If the value is not found, the default value of |
Exceptions
Since
File: PERProcs.h |
Line: 2300 |
PDEExtGStateGetOpacityStroke | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 the value of the / CA key in the ExtGState dictionary. If the value is not found, the default value of |
Exceptions
Since
File: PERProcs.h |
Line: 2315 |
PDEExtGStateGetOPFill | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 the value of the / op key in the ExtGState dictionary. If the value is not found, the default value of |
Exceptions
Since
File: PERProcs.h |
Line: 2270 |
PDEExtGStateGetOPM | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASInt32 PDEExtGStateGetOPM(INPDEExtGState pdeExtGState)
Returns the overprint mode used by this graphics state.
Parameters
pdeExtGState — | IN/OUT The extended graphics state object. |
The Cos integer value. |
Exceptions
Since
File: PERProcs.h |
Line: 2255 |
PDEExtGStateGetOPStroke | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASBool PDEExtGStateGetOPStroke(INPDEExtGState pdeExtGState)
Returns whether overprint is enabled for stroke painting operations.
Parameters
pdeExtGState — | IN/OUT The extended graphics state object. |
Returns the value of the / OP key in the ExtGState dictionary. If the value is not found, the default value of |
Exceptions
Since
File: PERProcs.h |
Line: 2285 |
PDEExtGStateGetSA | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASBool PDEExtGStateGetSA(INPDEExtGState pdeExtGState)
Returns whether stroke adjustment is enabled in the graphics state.
Parameters
pdeExtGState — | IN/OUT The extended graphics state object. |
Returns the value of the / SA key in the ExtGState dictionary. If the value is not set, the default value of |
Exceptions
Since
File: PERProcs.h |
Line: 2531 |
PDEExtGStateGetTK | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASBool PDEExtGStateGetTK(INPDEExtGState pdeExtGState)
Returns whether text knockout is enabled in the graphics state.
Parameters
pdeExtGState — | IN/OUT The extended graphics state object. |
Returns the value of the / TK key in the ExtGState dictionary. If the value is not found, the default value of |
Exceptions
Since
File: PERProcs.h |
Line: 2481 |
PDEExtGStateHasSoftMask | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
ASBool PDEExtGStateHasSoftMask(INPDEExtGState pdeExtGState)
Returns whether the graphics state contains a soft mask.
Parameters
pdeExtGState — | IN/OUT The extended graphics state object. |
Returns |
Exceptions
Since
File: PERProcs.h |
Line: 2379 |
PDEExtGStateSetAIS | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 ( |
Since
File: PEWProcs.h |
Line: 2155 |
PDEExtGStateSetBlendMode | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
void PDEExtGStateSetBlendMode(INPDEExtGState pdeExtGState, INASAtom blendMode)
Sets the blend mode for the color composites for each object painted.
The following mode names are valid:
Compatible
Normal
Multiply
Screen
Difference
Darken
Lighten
ColorDodge
ColorBurn
Exclusion
HardLight
Overlay
SoftLight
Luminosity
Hue
Saturation
Color
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 |
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 — |
Since
File: PEWProcs.h |
Line: 2086 |
PDEExtGStateSetOpacityStroke | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 — |
Since
File: PEWProcs.h |
Line: 2103 |
PDEExtGStateSetOPFill | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
Since
File: PEWProcs.h |
Line: 2054 |
PDEExtGStateSetOPM | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
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 |
Since
File: PEWProcs.h |
Line: 2069 |
PDEExtGStateSetSA | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
Exceptions
Since
File: PEWProcs.h |
Line: 2471 |
PDEExtGStateSetSoftMask | () |
Product availability: Acrobat, PDFL |
Platform availability: Macintosh, Windows, UNIX |
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 |
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 |
Since
File: PEWProcs.h |
Line: 2280 |