Class PdfExtGState
java.lang.Object
com.itextpdf.kernel.pdf.PdfObjectWrapper<PdfDictionary>
com.itextpdf.kernel.pdf.extgstate.PdfExtGState
Graphics state parameter dictionary wrapper. See ISO-320001, 8.4.5 Graphics State Parameter Dictionaries.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PdfNameStandard nonseparable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard nonseparable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard nonseparable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard nonseparable blend mode.static final PdfNameStandard separable blend mode.static final PdfNameStandard separable blend mode. -
Constructor Summary
ConstructorsConstructorDescriptionCreate default instance of graphics state parameter dictionaryPdfExtGState(PdfDictionary pdfObject) Create instance of graphics state parameter dictionary wrapper by existedPdfDictionaryobject -
Method Summary
Modifier and TypeMethodDescriptionvoidflush()To manually flush aPdfObjectbehind this wrapper, you have to ensure that this object is added to the document, i.e.Gets the alpha source flag ("alpha is shape"), specifying whether the current soft mask and alpha constant shall be interpreted as shape values (true) or opacity values (false),AISkey.Gets value of an automatic stroke adjustment flag,SAkey.Gets the black-generation function value,BG.Gets the black-generation function value orDefault,BG2key.Gets the current blend mode for the transparent imaging model,BMkey.Gets line dash pattern value,Dkey.Gets the current alpha constant, specifying the constant shape or constant opacity value for non-stroking operations in the transparent imaging model,cakey.Get overprint flag value for non-stroking operations,opkey.Gets the flatness tolerance value,FLkey.getFont()Gets font and size,Fontkey.Gets the halftone dictionary, stream orDefault,HTkey.float[]PDF 2.0.Gets line gap style value,LCkey.Gets line join style value,LJkey.Gets line width value,LWkey.Gets miter limit value,ML key.Get overprint control mode,OPMkey.Gets rendering intent value,RIkey.Gets the smoothness tolerance value,SMkey.Gets the current soft mask,SMaskkey.Gets the current alpha constant, specifying the constant shape or constant opacity value for stroking operations in the transparent imaging model,CAkey.Get overprint flag value for stroking operations,OPkey.Gets the text knockout flag, which determine the behaviour of overlapping glyphs within a text object in the transparent imaging model,TKkey.Gets the transfer function value,TRkey.Gets the transfer function value orDefault,TR2key.Gets the undercolor-removal function,UCRkey.Gets the undercolor-removal function value orDefault,UCR2key.PDF 2.0.protected booleanDefines if the object behind this wrapper must be an indirect object in the resultant document.Puts the value into Graphics state parameter dictionary and associates it with the specified key.setAlphaSourceFlag(boolean alphaSourceFlag) Sets the alpha source flag ("alpha is shape"), specifying whether the current soft mask and alpha constant shall be interpreted as shape values (true) or opacity values (false),AISkey.setAutomaticStrokeAdjustmentFlag(boolean strokeAdjustment) Sets value of an automatic stroke adjustment flag,SAkey.setBlackGenerationFunction(PdfObject blackGenerationFunction) Sets the black-generation function value,BG.setBlackGenerationFunction2(PdfObject blackGenerationFunction2) Sets the black-generation function value orDefault,BG2key.setBlendMode(PdfObject blendMode) Sets the current blend mode for the transparent imaging model,BMkey.setDashPattern(PdfArray dashPattern) Sets line dash pattern value,Dkey.setFillOpacity(float fillingAlphaConstant) Sets the current alpha constant, specifying the constant shape or constant opacity value for non-stroking operations in the transparent imaging model,cakey.setFillOverPrintFlag(boolean fillOverprintFlag) Set overprint flag value for non-stroking operations,opkey.setFlatnessTolerance(float flatnessTolerance) Sets the flatness tolerance value,FLkey.Sets font and size,Fontkey.setHalftone(PdfObject halftone) Sets the halftone orDefault,HTkey.setHalftoneOrigin(float x, float y) PDF 2.0.setLineCapStyle(int lineCapStyle) Sets line gap style value,LCkey.setLineJoinStyle(int lineJoinStyle) Sets line join style value,LJkey.setLineWidth(float lineWidth) Sets line width value,LWkey.setMiterLimit(float miterLimit) Sets miter limit value,ML key.setOverprintMode(int overprintMode) Set overprint control mode,OPMkey.setRenderingIntent(PdfName renderingIntent) Sets rendering intent value,RIkey.setSmoothnessTolerance(float smoothnessTolerance) Sets the smoothness tolerance value,SMkey.setSoftMask(PdfObject sMask) Sets the current soft mask,SMaskkey.setStrokeOpacity(float strokingAlphaConstant) Sets the current alpha constant, specifying the constant shape or constant opacity value for stroking operations in the transparent imaging model,CAkey.setStrokeOverPrintFlag(boolean strokeOverPrintFlag) Set overprint flag value for stroking operations,OPkey.setTextKnockoutFlag(boolean textKnockoutFlag) Sets the text knockout flag, which determine the behaviour of overlapping glyphs within a text object in the transparent imaging model,TKkey.setTransferFunction(PdfObject transferFunction) Sets the transfer function value,TRkey.setTransferFunction2(PdfObject transferFunction2) Sets the transfer function value orDefault,TR2key.setUndercolorRemovalFunction(PdfObject undercolorRemovalFunction) Sets the undercolor-removal function,UCRkey.setUndercolorRemovalFunction2(PdfObject undercolorRemovalFunction2) Sets the undercolor-removal function value orDefault,UCR2key.setUseBlackPointCompensation(boolean useBlackPointCompensation) PDF 2.0.Methods inherited from class com.itextpdf.kernel.pdf.PdfObjectWrapper
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, setPdfObject, unsetForbidRelease
-
Field Details
-
BM_NORMAL
Standard separable blend mode. See ISO-320001, table 136 -
BM_MULTIPLY
Standard separable blend mode. See ISO-320001, table 136 -
BM_SCREEN
Standard separable blend mode. See ISO-320001, table 136 -
BM_OVERLAY
Standard separable blend mode. See ISO-320001, table 136 -
BM_DARKEN
Standard separable blend mode. See ISO-320001, table 136 -
BM_LIGHTEN
Standard separable blend mode. See ISO-320001, table 136 -
BM_COLOR_DODGE
Standard separable blend mode. See ISO-320001, table 136 -
BM_COLOR_BURN
Standard separable blend mode. See ISO-320001, table 136 -
BM_HARD_LIGHT
Standard separable blend mode. See ISO-320001, table 136 -
BM_SOFT_LIGHT
Standard separable blend mode. See ISO-320001, table 136 -
BM_DIFFERENCE
Standard separable blend mode. See ISO-320001, table 136 -
BM_EXCLUSION
Standard separable blend mode. See ISO-320001, table 136 -
BM_HUE
Standard nonseparable blend mode. See ISO-320001, table 137 -
BM_SATURATION
Standard nonseparable blend mode. See ISO-320001, table 137 -
BM_COLOR
Standard nonseparable blend mode. See ISO-320001, table 137 -
BM_LUMINOSITY
Standard nonseparable blend mode. See ISO-320001, table 137
-
-
Constructor Details
-
PdfExtGState
Create instance of graphics state parameter dictionary wrapper by existedPdfDictionaryobject- Parameters:
-
pdfObject- instance of graphics state parameter dictionary
-
PdfExtGState
public PdfExtGState()Create default instance of graphics state parameter dictionary
-
-
Method Details
-
getLineWidth
Gets line width value,LWkey.- Returns:
-
a
floatvalue if exist, otherwisenull.
-
setLineWidth
Sets line width value,LWkey.- Parameters:
-
lineWidth- afloatvalue. - Returns:
- object itself.
-
getLineCapStyle
Gets line gap style value,LCkey.- Returns:
- 0 - butt cap, 1 - round cap, 2 - projecting square cap.
-
setLineCapStyle
Sets line gap style value,LCkey.- Parameters:
-
lineCapStyle- 0 - butt cap, 1 - round cap, 2 - projecting square cap. - Returns:
- object itself.
-
getLineJoinStyle
Gets line join style value,LJkey.- Returns:
- 0 - miter join (see also miter limit), 1 - round join, 2 - bevel join.
-
setLineJoinStyle
Sets line join style value,LJkey.- Parameters:
-
lineJoinStyle- 0 - miter join (see also miter limit), 1 - round join, 2 - bevel join. - Returns:
- object itself.
-
getMiterLimit
Gets miter limit value,ML key. See also line join style.- Returns:
-
a
floatvalue if exist, otherwisenull.
-
setMiterLimit
Sets miter limit value,ML key. See also line join style.- Parameters:
-
miterLimit- afloatvalue. - Returns:
- object itself.
-
getDashPattern
Gets line dash pattern value,Dkey.- Returns:
-
a
PdfArray, that represents line dash pattern.
-
setDashPattern
Sets line dash pattern value,Dkey.- Parameters:
-
dashPattern- aPdfArray, that represents line dash pattern. - Returns:
- object itself.
-
getRenderingIntent
Gets rendering intent value,RIkey. Valid values are:AbsoluteColorimetric,RelativeColorimetric,Saturation,Perceptual.- Returns:
-
a
PdfNameinstance.
-
setRenderingIntent
Sets rendering intent value,RIkey.- Parameters:
-
renderingIntent- aPdfNameinstance, Valid values are:AbsoluteColorimetric,RelativeColorimetric,Saturation,Perceptual. - Returns:
- object itself.
-
getStrokeOverprintFlag
Get overprint flag value for stroking operations,OPkey.- Returns:
-
a
booleanvalue if exist, otherwisenull.
-
setStrokeOverPrintFlag
Set overprint flag value for stroking operations,OPkey.- Parameters:
-
strokeOverPrintFlag-true, for applying overprint for stroking operations. - Returns:
- object itself.
-
getFillOverprintFlag
Get overprint flag value for non-stroking operations,opkey.- Returns:
-
a
booleanvalue if exist, otherwisenull.
-
setFillOverPrintFlag
Set overprint flag value for non-stroking operations,opkey.- Parameters:
-
fillOverprintFlag-true, for applying overprint for non-stroking operations. - Returns:
- object itself.
-
getOverprintMode
Get overprint control mode,OPMkey.- Returns:
-
an
intvalue if exist, otherwisenull.
-
setOverprintMode
Set overprint control mode,OPMkey.- Parameters:
-
overprintMode- anintvalue, see ISO-320001, 8.6.7 Overprint Control. - Returns:
- object itself.
-
getFont
Gets font and size,Fontkey.- Returns:
-
a
PdfArrayof the form[font size], wherefontshall be an indirect reference to a font dictionary andsizeshall be a number expressed in text space units.
-
setFont
Sets font and size,Fontkey. NOTE: If you want add the font object which has just been created, make sure to register the font withPdfDocument.addFont(PdfFont)method first.- Parameters:
-
font- aPdfArrayof the form[font size], wherefontshall be an indirect reference to a font dictionary andsizeshall be a number expressed in text space units. - Returns:
- object itself.
-
getBlackGenerationFunction
Gets the black-generation function value,BG.- Returns:
-
a
PdfObject, should be an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects).
-
setBlackGenerationFunction
Sets the black-generation function value,BG.- Parameters:
-
blackGenerationFunction- aPdfObject, shall be an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects). - Returns:
- object itself.
-
getBlackGenerationFunction2
Gets the black-generation function value orDefault,BG2key.- Returns:
-
the returned value is
PdfObjectvalue, which is either aPdfNameof a predefined value or an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects).
-
setBlackGenerationFunction2
Sets the black-generation function value orDefault,BG2key. Note, if bothBGandBG2are present in the same graphics state parameter dictionary,BG2takes precedence.- Parameters:
-
blackGenerationFunction2- aPdfObjectvalue, shall be an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects) orDefault. - Returns:
- object itself.
-
getUndercolorRemovalFunction
Gets the undercolor-removal function,UCRkey.- Returns:
-
a
PdfObject, should be an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects).
-
setUndercolorRemovalFunction
Sets the undercolor-removal function,UCRkey.- Parameters:
-
undercolorRemovalFunction- aPdfObject, shall be an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects). - Returns:
- object itself.
-
getUndercolorRemovalFunction2
Gets the undercolor-removal function value orDefault,UCR2key.- Returns:
-
the returned value is
PdfObjectvalue, which is either aPdfNameof a predefined value or an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects).
-
setUndercolorRemovalFunction2
Sets the undercolor-removal function value orDefault,UCR2key. Note, if bothUCRandUCR2are present in the same graphics state parameter dictionary,UCR2takes precedence.- Parameters:
-
undercolorRemovalFunction2- aPdfObjectvalue, shall be an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects) orDefault. - Returns:
- object itself.
-
getTransferFunction
Gets the transfer function value,TRkey.- Returns:
-
the returned value is
PdfObjectvalue, which is either aPdfNameorPdfArrayof a predefined value or an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects).
-
setTransferFunction
Sets the transfer function value,TRkey.- Parameters:
-
transferFunction- aPdfObject, shall be either aPdfNameorPdfArrayof a predefined value or an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects). - Returns:
- object itself.
-
getTransferFunction2
Gets the transfer function value orDefault,TR2key.- Returns:
-
the returned value is
PdfObjectvalue, which is either aPdfNameorPdfArrayof a predefined value or an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects).
-
setTransferFunction2
Sets the transfer function value orDefault,TR2key. Note, if bothTRandTR2are present in the same graphics state parameter dictionary,TR2takes precedence.- Parameters:
-
transferFunction2- aPdfObject, shall be either aPdfNameorPdfArrayof a predefined value or an object representing custom function (seeIPdfFunctionobject wrapper for convenience API in reading/manipulating such function objects). - Returns:
- object itself.
-
getHalftone
Gets the halftone dictionary, stream orDefault,HTkey.- Returns:
-
a
PdfObject, should be eitherPdfDictionary,PdfStreamorPdfName.
-
setHalftone
Sets the halftone orDefault,HTkey.- Parameters:
-
halftone- aPdfObject, shall be eitherPdfDictionary,PdfStreamorPdfName. - Returns:
- object itself.
-
getFlatnessTolerance
Gets the flatness tolerance value,FLkey.- Returns:
-
a
floatvalue if exist, otherwisenull.
-
setFlatnessTolerance
Sets the flatness tolerance value,FLkey.- Parameters:
-
flatnessTolerance- afloatvalue. - Returns:
- object itself.
-
getSmothnessTolerance
Gets the smoothness tolerance value,SMkey.- Returns:
-
a
floatvalue if exist, otherwisenull.
-
setSmoothnessTolerance
Sets the smoothness tolerance value,SMkey.- Parameters:
-
smoothnessTolerance- afloatvalue. - Returns:
- object itself.
-
getAutomaticStrokeAdjustmentFlag
Gets value of an automatic stroke adjustment flag,SAkey.- Returns:
-
a
booleanvalue if exist, otherwisenull.
-
setAutomaticStrokeAdjustmentFlag
Sets value of an automatic stroke adjustment flag,SAkey.- Parameters:
-
strokeAdjustment- abooleanvalue. - Returns:
- object itself.
-
getBlendMode
Gets the current blend mode for the transparent imaging model,BMkey. -
setBlendMode
Sets the current blend mode for the transparent imaging model,BMkey. -
getSoftMask
Gets the current soft mask,SMaskkey.- Returns:
-
a
PdfObject, should be eitherPdfNameorPdfDictionary.
-
setSoftMask
Sets the current soft mask,SMaskkey.- Parameters:
-
sMask- aPdfObject, shall be eitherPdfNameorPdfDictionary. - Returns:
- object itself.
-
getStrokeOpacity
Gets the current alpha constant, specifying the constant shape or constant opacity value for stroking operations in the transparent imaging model,CAkey.- Returns:
-
a
floatvalue if exist, otherwisenull.
-
setStrokeOpacity
Sets the current alpha constant, specifying the constant shape or constant opacity value for stroking operations in the transparent imaging model,CAkey.- Parameters:
-
strokingAlphaConstant- afloatvalue. - Returns:
- object itself.
-
getFillOpacity
Gets the current alpha constant, specifying the constant shape or constant opacity value for non-stroking operations in the transparent imaging model,cakey.- Returns:
-
a
floatvalue if exist, otherwisenull.
-
setFillOpacity
Sets the current alpha constant, specifying the constant shape or constant opacity value for non-stroking operations in the transparent imaging model,cakey.- Parameters:
-
fillingAlphaConstant- afloatvalue. - Returns:
- object itself.
-
getAlphaSourceFlag
Gets the alpha source flag ("alpha is shape"), specifying whether the current soft mask and alpha constant shall be interpreted as shape values (true) or opacity values (false),AISkey.- Returns:
-
a
booleanvalue if exist, otherwisenull.
-
setAlphaSourceFlag
Sets the alpha source flag ("alpha is shape"), specifying whether the current soft mask and alpha constant shall be interpreted as shape values (true) or opacity values (false),AISkey.- Parameters:
-
alphaSourceFlag- iftrue- alpha as shape values, iffalse— as opacity values. - Returns:
- object itself.
-
getTextKnockoutFlag
Gets the text knockout flag, which determine the behaviour of overlapping glyphs within a text object in the transparent imaging model,TKkey.- Returns:
-
a
booleanvalue if exist, otherwisenull.
-
setTextKnockoutFlag
Sets the text knockout flag, which determine the behaviour of overlapping glyphs within a text object in the transparent imaging model,TKkey.- Parameters:
-
textKnockoutFlag-trueif enabled. - Returns:
- object itself.
-
setUseBlackPointCompensation
PDF 2.0. This graphics state parameter controls whether black point compensation is performed while doing CIE-based colour conversions.- Parameters:
-
useBlackPointCompensation-trueto enable,falseto disable - Returns:
- object itself
-
isBlackPointCompensationUsed
PDF 2.0. Checks whether the black point compensation is performed while doing CIE-based colour conversions.- Returns:
-
trueif black point compensation is used,falseif it is not used, ornullis the value is set to Default, or not set at all
-
setHalftoneOrigin
PDF 2.0. Sets halftone origin- Parameters:
-
x- X location of the halftone origin in the current coordinate system -
y- Y location of the halftone origin in the current coordinate system - Returns:
-
this
PdfExtGStateinstance
-
getHalftoneOrigin
public float[] getHalftoneOrigin()PDF 2.0. Gets halftone origin- Returns:
-
an array of two values specifying X and Y values of the halftone origin in the current coordinate system, respectively, or
nullif halftone origin is not specified
-
put
Puts the value into Graphics state parameter dictionary and associates it with the specified key. If the key is already present, it will override the old value with the specified one.- Parameters:
-
key- key to insert or to override -
value- the value to associate with the specified key - Returns:
- object itself.
-
flush
public void flush()To manually flush aPdfObjectbehind this wrapper, you have to ensure that this object is added to the document, i.e. it has an indirect reference. Basically this means that before flushing you need to explicitly callPdfObjectWrapper.makeIndirect(PdfDocument). For example: wrapperInstance.makeIndirect(document).flush(); Note that not every wrapper require this, only those that have such warning in documentation.- Overrides:
-
flushin classPdfObjectWrapper<PdfDictionary>
-
isWrappedObjectMustBeIndirect
protected boolean isWrappedObjectMustBeIndirect()Defines if the object behind this wrapper must be an indirect object in the resultant document.
If this method returns true it doesn't necessarily mean that object must be in the indirect state at any moment, but rather defines that when the object will be written to the document it will be transformed into indirect object if it's not indirect yet.
Return value of this method shouldn't depend on any logic, it should return always true or false.- Specified by:
-
isWrappedObjectMustBeIndirectin classPdfObjectWrapper<PdfDictionary> - Returns:
- true if in the resultant document the object behind the wrapper must be indirect, otherwise false.
-