Package com.itextpdf.kernel.pdf.canvas
Class PdfPatternCanvas
- java.lang.Object
-
- com.itextpdf.kernel.pdf.canvas.PdfCanvas
-
- com.itextpdf.kernel.pdf.canvas.PdfPatternCanvas
-
public class PdfPatternCanvas extends PdfCanvas
A PdfCanvas instance with an inherent tiling pattern.
-
-
Field Summary
Fields Modifier and Type Field Description private PdfPattern.Tiling
tilingPattern
-
Fields inherited from class com.itextpdf.kernel.pdf.canvas.PdfCanvas
contentStream, currentGs, document, drawingOnPage, gsStack, layerDepth, mcDepth, resources
-
-
Constructor Summary
Constructors Constructor Description PdfPatternCanvas(PdfPattern.Tiling pattern, PdfDocument document)
Creates PdfPatternCanvas for a document from a provided Tiling patternPdfPatternCanvas(PdfStream contentStream, PdfResources resources, PdfDocument document)
Creates PdfPatternCanvas from content stream of page, form XObject, pattern etc.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkNoColor()
PdfCanvas
setColor(PdfColorSpace colorSpace, float[] colorValue, PdfPattern pattern, boolean fill)
Changes the current color for paths with an explicitly defined pattern.-
Methods inherited from class com.itextpdf.kernel.pdf.canvas.PdfCanvas
addImageAt, addImageFittedIntoRectangle, addImageWithTransformationMatrix, addImageWithTransformationMatrix, addInlineImage, addXObject, addXObjectAt, addXObjectFittedIntoRectangle, addXObjectWithTransformationMatrix, arc, arcContinuous, attachContentStream, beginLayer, beginMarkedContent, beginMarkedContent, beginText, beginVariableText, bezierArc, circle, clip, closePath, closePathEoFillStroke, closePathFillStroke, closePathStroke, closeTag, concatMatrix, concatMatrix, concatMatrix, curveFromTo, curveTo, curveTo, ellipse, endLayer, endMarkedContent, endPath, endText, endVariableText, eoClip, eoFill, eoFillStroke, fill, fillStroke, getContentStream, getDocument, getGraphicsState, getResources, lineTo, moveText, moveTextWithLeading, moveTo, newlineShowText, newlineShowText, newlineText, openTag, openTag, paintShading, rectangle, rectangle, release, resetFillColorCmyk, resetFillColorGray, resetFillColorRgb, resetStrokeColorCmyk, resetStrokeColorGray, resetStrokeColorRgb, restoreState, roundRectangle, roundRectangle, saveState, setCharacterSpacing, setColor, setColor, setDrawingOnPage, setExtGState, setExtGState, setFillColor, setFillColorCmyk, setFillColorGray, setFillColorRgb, setFillColorShading, setFlatnessTolerance, setFontAndSize, setHorizontalScaling, setLeading, setLineCapStyle, setLineDash, setLineDash, setLineDash, setLineDash, setLineJoinStyle, setLineWidth, setMiterLimit, setRenderingIntent, setStrokeColor, setStrokeColorCmyk, setStrokeColorGray, setStrokeColorRgb, setStrokeColorShading, setTextMatrix, setTextMatrix, setTextMatrix, setTextRenderingMode, setTextRise, setWordSpacing, showText, showText, showText, showText, stroke, writeLiteral, writeLiteral, writeLiteral
-
-
-
-
Field Detail
-
tilingPattern
private final PdfPattern.Tiling tilingPattern
-
-
Constructor Detail
-
PdfPatternCanvas
public PdfPatternCanvas(PdfStream contentStream, PdfResources resources, PdfDocument document)
Creates PdfPatternCanvas from content stream of page, form XObject, pattern etc.- Parameters:
contentStream
- The content streamresources
- The resources, a specialized dictionary that can be used by PDF instructions in the content streamdocument
- The document that the resulting content stream will be written to
-
PdfPatternCanvas
public PdfPatternCanvas(PdfPattern.Tiling pattern, PdfDocument document)
Creates PdfPatternCanvas for a document from a provided Tiling pattern- Parameters:
pattern
- The Tiling pattern must be coloreddocument
- The document that the resulting content stream will be written to
-
-
Method Detail
-
setColor
public PdfCanvas setColor(PdfColorSpace colorSpace, float[] colorValue, PdfPattern pattern, boolean fill)
Description copied from class:PdfCanvas
Changes the current color for paths with an explicitly defined pattern.- Overrides:
setColor
in classPdfCanvas
- Parameters:
colorSpace
- the color space of the new colorcolorValue
- a list of numerical values with a length corresponding to the specs of the color space. Values should be in the range [0,1]pattern
- a pattern for the colored line or areafill
- set fill color (true
) or stroke color (false
)- Returns:
- current canvas.
-
checkNoColor
private void checkNoColor()
-
-