Class PdfPatternPainter
-
Nested Class Summary
Nested classes/interfaces inherited from class PdfContentByte
PdfContentByte.GraphicState -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Colorprotected booleanprotected floatprotected floatFields inherited from class PdfTemplate
bBox, group, layer, matrix, pageResources, thisReference, type, TYPE_IMPORTED, TYPE_PATTERN, TYPE_TEMPLATEFields inherited from class PdfContentByte
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, content, layerDepth, LINE_CAP_BUTT, LINE_CAP_PROJECTING_SQUARE, LINE_CAP_ROUND, LINE_JOIN_BEVEL, LINE_JOIN_MITER, LINE_JOIN_ROUND, pdf, separator, state, stateList, TEXT_RENDER_MODE_CLIP, TEXT_RENDER_MODE_FILL, TEXT_RENDER_MODE_FILL_CLIP, TEXT_RENDER_MODE_FILL_STROKE, TEXT_RENDER_MODE_FILL_STROKE_CLIP, TEXT_RENDER_MODE_INVISIBLE, TEXT_RENDER_MODE_STROKE, TEXT_RENDER_MODE_STROKE_CLIP, writer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCreates aPdfPattern.(package private)Creates new PdfPattern(package private)PdfPatternPainter(PdfWriter wr, Color defaultColor) -
Method Summary
Modifier and TypeMethodDescription(package private) voidReturns the default color of the pattern.Gets a duplicate of thisPdfPatternPainter.(package private) PdfPatternGets the stream representing this patternfloatgetXStep()Returns the horizontal interval when repeating the pattern.floatgetYStep()Returns the vertical interval when repeating the pattern.booleanTells you if this pattern is colored/uncolored (stencil = uncolored, you need to set a default color).voidChanges the current color for filling paths to black.voidChanges the current color for stroking paths to black.voidChanges the current gray tint for filling paths to black.voidChanges the current gray tint for stroking paths to black.voidChanges the current color for filling paths to black.voidChanges the current color for stroking paths to black.voidsetCMYKColorFill(int cyan, int magenta, int yellow, int black) Changes the current color for filling paths (device dependent colors!).voidsetCMYKColorFillF(float cyan, float magenta, float yellow, float black) Changes the current color for filling paths (device dependent colors!).voidsetCMYKColorStroke(int cyan, int magenta, int yellow, int black) Changes the current color for stroking paths (device dependent colors!).voidsetCMYKColorStrokeF(float cyan, float magenta, float yellow, float black) Changes the current color for stroking paths (device dependent colors!).voidsetColorFill(PdfSpotColor sp, float tint) Sets the fill color to a spot color.voidsetColorFill(Color color) Sets the fill color.voidsetColorStroke(PdfSpotColor sp, float tint) Sets the stroke color to a spot color.voidsetColorStroke(Color color) Sets the stroke color.voidsetGrayFill(float gray) Changes the currentgray tint for filling paths (device dependent colors!).voidsetGrayStroke(float gray) Changes the currentgray tint for stroking paths (device dependent colors!).voidSets the fill color to a pattern.voidsetPatternFill(PdfPatternPainter p, Color color, float tint) Sets the fill color to an uncolored pattern.voidsetPatternMatrix(float a, float b, float c, float d, float e, float f) Sets the transformation matrix for the pattern.voidSets the stroke color to a pattern.voidsetPatternStroke(PdfPatternPainter p, Color color, float tint) Sets the stroke color to an uncolored pattern.voidsetRGBColorFill(int red, int green, int blue) Changes the current color for filling paths (device dependent colors!).voidsetRGBColorFillF(float red, float green, float blue) Changes the current color for filling paths (device dependent colors!).voidsetRGBColorStroke(int red, int green, int blue) Changes the current color for stroking paths (device dependent colors!).voidsetRGBColorStrokeF(float red, float green, float blue) Changes the current color for stroking paths (device dependent colors!).voidsetXStep(float xstep) Sets the horizontal interval of this pattern.voidsetYStep(float ystep) Sets the vertical interval of this pattern.Methods inherited from class PdfTemplate
beginVariableText, endVariableText, getBoundingBox, getFormXObject, getGroup, getHeight, getIndirectReference, getLayer, getMatrix, getPageResources, getResources, getType, getWidth, setBoundingBox, setGroup, setHeight, setLayer, setMatrix, setWidthMethods inherited from class PdfContentByte
add, addAnnotation, addOutline, addOutline, addPSXObject, addTemplate, addTemplate, arc, beginLayer, beginMarkedContentSequence, beginMarkedContentSequence, beginMarkedContentSequence, beginText, bezierArc, checkNoPattern, checkWriter, circle, clip, closePath, closePathEoFillStroke, closePathFillStroke, closePathStroke, concatCTM, createAppearance, createAppearance, createPattern, createPattern, createPattern, createPattern, createTemplate, createTemplate, curveFromTo, curveTo, curveTo, drawButton, drawRadioField, drawTextField, ellipse, endLayer, endMarkedContentSequence, endText, eoClip, eoFill, eoFillStroke, escapeString, escapeString, fill, fillStroke, getInternalBuffer, getKernArray, getLeading, getPdfDocument, getPdfWriter, getRootOutline, getXTLM, getYTLM, lineTo, localDestination, localGoto, moveText, moveTextWithLeading, moveTo, newlineShowText, newlineShowText, newlineText, newPath, outputColorNumbers, paintShading, paintShading, rectangle, rectangle, remoteGoto, remoteGoto, reset, restoreState, roundRectangle, saveState, setAction, setCharacterSpacing, setDefaultColorspace, setFlatness, setFontAndSize, setGState, setHorizontalScaling, setLeading, setLineCap, setLineDash, setLineDash, setLineDash, setLineDash, setLineJoin, setLineWidth, setLiteral, setLiteral, setLiteral, setMiterLimit, setPatternFill, setPatternStroke, setShadingFill, setShadingStroke, setTextMatrix, setTextMatrix, setTextRenderingMode, setTextRise, setWordSpacing, showText, showText, showTextAligned, showTextAlignedKerned, showTextKerned, size, stroke, toPdf, toString, transform, variableRectangle
-
Field Details
-
xstep
protected float xstep -
ystep
protected float ystep -
stencil
protected boolean stencil -
defaultColor
-
-
Constructor Details
-
PdfPatternPainter
private PdfPatternPainter()Creates aPdfPattern. -
PdfPatternPainter
-
PdfPatternPainter
-
-
Method Details
-
setXStep
public void setXStep(float xstep) Sets the horizontal interval of this pattern.- Parameters:
xstep- the xstep in horizontal painting
-
setYStep
public void setYStep(float ystep) Sets the vertical interval of this pattern.- Parameters:
ystep- in vertical painting
-
getXStep
public float getXStep()Returns the horizontal interval when repeating the pattern.- Returns:
- a value
-
getYStep
public float getYStep()Returns the vertical interval when repeating the pattern.- Returns:
- a value
-
isStencil
public boolean isStencil()Tells you if this pattern is colored/uncolored (stencil = uncolored, you need to set a default color).- Returns:
- true if the pattern is an uncolored tiling pattern (stencil).
-
setPatternMatrix
public void setPatternMatrix(float a, float b, float c, float d, float e, float f) Sets the transformation matrix for the pattern.- Parameters:
a-b-c-d-e-f-
-
getPattern
PdfPattern getPattern()Gets the stream representing this pattern- Returns:
- the stream representing this pattern
-
getDuplicate
Gets a duplicate of thisPdfPatternPainter. All the members are copied by reference but the buffer stays different.- Overrides:
getDuplicatein classPdfTemplate- Returns:
- a copy of this
PdfPatternPainter
-
getDefaultColor
-
setGrayFill
public void setGrayFill(float gray) Description copied from class:PdfContentByteChanges the currentgray tint for filling paths (device dependent colors!).Sets the color space to DeviceGray (or the DefaultGray color space), and sets the gray tint to use for filling paths.
- Overrides:
setGrayFillin classPdfContentByte- Parameters:
gray- a value between 0 (black) and 1 (white)- See Also:
-
resetGrayFill
public void resetGrayFill()Description copied from class:PdfContentByteChanges the current gray tint for filling paths to black.- Overrides:
resetGrayFillin classPdfContentByte- See Also:
-
setGrayStroke
public void setGrayStroke(float gray) Description copied from class:PdfContentByteChanges the currentgray tint for stroking paths (device dependent colors!).Sets the color space to DeviceGray (or the DefaultGray color space), and sets the gray tint to use for stroking paths.
- Overrides:
setGrayStrokein classPdfContentByte- Parameters:
gray- a value between 0 (black) and 1 (white)- See Also:
-
resetGrayStroke
public void resetGrayStroke()Description copied from class:PdfContentByteChanges the current gray tint for stroking paths to black.- Overrides:
resetGrayStrokein classPdfContentByte- See Also:
-
setRGBColorFillF
public void setRGBColorFillF(float red, float green, float blue) Description copied from class:PdfContentByteChanges the current color for filling paths (device dependent colors!).Sets the color space to DeviceRGB (or the DefaultRGB color space), and sets the color to use for filling paths.
Following the PDF manual, each operand must be a number between 0 (minimum intensity) and 1 (maximum intensity).
- Overrides:
setRGBColorFillFin classPdfContentByte- Parameters:
red- the intensity of red. A value between 0 and 1green- the intensity of green. A value between 0 and 1blue- the intensity of blue. A value between 0 and 1- See Also:
-
resetRGBColorFill
public void resetRGBColorFill()Description copied from class:PdfContentByteChanges the current color for filling paths to black.- Overrides:
resetRGBColorFillin classPdfContentByte- See Also:
-
setRGBColorStrokeF
public void setRGBColorStrokeF(float red, float green, float blue) Description copied from class:PdfContentByteChanges the current color for stroking paths (device dependent colors!).Sets the color space to DeviceRGB (or the DefaultRGB color space), and sets the color to use for stroking paths.
Following the PDF manual, each operand must be a number between 0 (miniumum intensity) and 1 (maximum intensity).
- Overrides:
setRGBColorStrokeFin classPdfContentByte- Parameters:
red- the intensity of red. A value between 0 and 1green- the intensity of green. A value between 0 and 1blue- the intensity of blue. A value between 0 and 1- See Also:
-
resetRGBColorStroke
public void resetRGBColorStroke()Description copied from class:PdfContentByteChanges the current color for stroking paths to black.- Overrides:
resetRGBColorStrokein classPdfContentByte- See Also:
-
setCMYKColorFillF
public void setCMYKColorFillF(float cyan, float magenta, float yellow, float black) Description copied from class:PdfContentByteChanges the current color for filling paths (device dependent colors!).Sets the color space to DeviceCMYK (or the DefaultCMYK color space), and sets the color to use for filling paths.
Following the PDF manual, each operand must be a number between 0 (no ink) and 1 (maximum ink).
- Overrides:
setCMYKColorFillFin classPdfContentByte- Parameters:
cyan- the intensity of cyan. A value between 0 and 1magenta- the intensity of magenta. A value between 0 and 1yellow- the intensity of yellow. A value between 0 and 1black- the intensity of black. A value between 0 and 1- See Also:
-
resetCMYKColorFill
public void resetCMYKColorFill()Description copied from class:PdfContentByteChanges the current color for filling paths to black.- Overrides:
resetCMYKColorFillin classPdfContentByte- See Also:
-
setCMYKColorStrokeF
public void setCMYKColorStrokeF(float cyan, float magenta, float yellow, float black) Description copied from class:PdfContentByteChanges the current color for stroking paths (device dependent colors!).Sets the color space to DeviceCMYK (or the DefaultCMYK color space), and sets the color to use for stroking paths.
Following the PDF manual, each operand must be a number between 0 (miniumum intensity) and 1 (maximum intensity).
- Overrides:
setCMYKColorStrokeFin classPdfContentByte- Parameters:
cyan- the intensity of cyan. A value between 0 and 1magenta- the intensity of magenta. A value between 0 and 1yellow- the intensity of yellow. A value between 0 and 1black- the intensity of black. A value between 0 and 1- See Also:
-
resetCMYKColorStroke
public void resetCMYKColorStroke()Description copied from class:PdfContentByteChanges the current color for stroking paths to black.- Overrides:
resetCMYKColorStrokein classPdfContentByte- See Also:
-
setCMYKColorFill
public void setCMYKColorFill(int cyan, int magenta, int yellow, int black) Description copied from class:PdfContentByteChanges the current color for filling paths (device dependent colors!).Sets the color space to DeviceCMYK (or the DefaultCMYK color space), and sets the color to use for filling paths.
This method is described in the 'Portable Document Format Reference Manual version 1.3' section 8.5.2.1 (page 331).
Following the PDF manual, each operand must be a number between 0 (no ink) and 1 (maximum ink). This method however accepts only integers between 0x00 and 0xFF.
- Overrides:
setCMYKColorFillin classPdfContentByte- Parameters:
cyan- the intensity of cyanmagenta- the intensity of magentayellow- the intensity of yellowblack- the intensity of black- See Also:
-
setCMYKColorStroke
public void setCMYKColorStroke(int cyan, int magenta, int yellow, int black) Description copied from class:PdfContentByteChanges the current color for stroking paths (device dependent colors!).Sets the color space to DeviceCMYK (or the DefaultCMYK color space), and sets the color to use for stroking paths.
This method is described in the 'Portable Document Format Reference Manual version 1.3' section 8.5.2.1 (page 331).
Following the PDF manual, each operand must be a number between 0 (miniumum intensity) and 1 (maximum intensity). This method however accepts only integers between 0x00 and 0xFF.- Overrides:
setCMYKColorStrokein classPdfContentByte- Parameters:
cyan- the intensity of redmagenta- the intensity of greenyellow- the intensity of blueblack- the intensity of black- See Also:
-
setRGBColorFill
public void setRGBColorFill(int red, int green, int blue) Description copied from class:PdfContentByteChanges the current color for filling paths (device dependent colors!).Sets the color space to DeviceRGB (or the DefaultRGB color space), and sets the color to use for filling paths.
This method is described in the 'Portable Document Format Reference Manual version 1.3' section 8.5.2.1 (page 331).
Following the PDF manual, each operand must be a number between 0 (miniumum intensity) and 1 (maximum intensity). This method however accepts only integers between 0x00 and 0xFF.
- Overrides:
setRGBColorFillin classPdfContentByte- Parameters:
red- the intensity of redgreen- the intensity of greenblue- the intensity of blue- See Also:
-
setRGBColorStroke
public void setRGBColorStroke(int red, int green, int blue) Description copied from class:PdfContentByteChanges the current color for stroking paths (device dependent colors!).Sets the color space to DeviceRGB (or the DefaultRGB color space), and sets the color to use for stroking paths.
This method is described in the 'Portable Document Format Reference Manual version 1.3' section 8.5.2.1 (page 331).
Following the PDF manual, each operand must be a number between 0 (miniumum intensity) and 1 (maximum intensity). This method however accepts only integers between 0x00 and 0xFF.- Overrides:
setRGBColorStrokein classPdfContentByte- Parameters:
red- the intensity of redgreen- the intensity of greenblue- the intensity of blue- See Also:
-
setColorStroke
Description copied from class:PdfContentByteSets the stroke color.colorcan be anExtendedColor.- Overrides:
setColorStrokein classPdfContentByte- Parameters:
color- the color- See Also:
-
setColorFill
Description copied from class:PdfContentByteSets the fill color.colorcan be anExtendedColor.- Overrides:
setColorFillin classPdfContentByte- Parameters:
color- the color- See Also:
-
setColorFill
Description copied from class:PdfContentByteSets the fill color to a spot color.- Overrides:
setColorFillin classPdfContentByte- Parameters:
sp- the spot colortint- the tint for the spot color. 0 is no color and 1 is 100% color- See Also:
-
setColorStroke
Description copied from class:PdfContentByteSets the stroke color to a spot color.- Overrides:
setColorStrokein classPdfContentByte- Parameters:
sp- the spot colortint- the tint for the spot color. 0 is no color and 1 is 100% color- See Also:
-
setPatternFill
Description copied from class:PdfContentByteSets the fill color to a pattern. The pattern can be colored or uncolored.- Overrides:
setPatternFillin classPdfContentByte- Parameters:
p- the pattern- See Also:
-
setPatternFill
Description copied from class:PdfContentByteSets the fill color to an uncolored pattern.- Overrides:
setPatternFillin classPdfContentByte- Parameters:
p- the patterncolor- the color of the patterntint- the tint if the color is a spot color, ignored otherwise- See Also:
-
setPatternStroke
Description copied from class:PdfContentByteSets the stroke color to an uncolored pattern.- Overrides:
setPatternStrokein classPdfContentByte- Parameters:
p- the patterncolor- the color of the patterntint- the tint if the color is a spot color, ignored otherwise- See Also:
-
setPatternStroke
Description copied from class:PdfContentByteSets the stroke color to a pattern. The pattern can be colored or uncolored.- Overrides:
setPatternStrokein classPdfContentByte- Parameters:
p- the pattern- See Also:
-
checkNoColor
void checkNoColor()
-