Package com.itextpdf.kernel.pdf.canvas
Class PdfPatternCanvas
java.lang.Object
com.itextpdf.kernel.pdf.canvas.PdfCanvas
com.itextpdf.kernel.pdf.canvas.PdfPatternCanvas
A PdfCanvas instance with an inherent tiling pattern.
-
Field Summary
Fields inherited from class com.itextpdf.kernel.pdf.canvas.PdfCanvas
contentStream, currentGs, document, gsStack, layerDepth, mcDepth, resources
-
Constructor Summary
ConstructorDescriptionPdfPatternCanvas
(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
Modifier and TypeMethodDescriptionsetColor
(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, saveState, setCharacterSpacing, setColor, setColor, 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
-
Constructor Details
-
PdfPatternCanvas
Creates PdfPatternCanvas from content stream of page, form XObject, pattern etc.- Parameters:
-
contentStream
- The content stream -
resources
- The resources, a specialized dictionary that can be used by PDF instructions in the content stream -
document
- The document that the resulting content stream will be written to
-
PdfPatternCanvas
Creates PdfPatternCanvas for a document from a provided Tiling pattern- Parameters:
-
pattern
- The Tiling pattern must be colored -
document
- The document that the resulting content stream will be written to
-
-
Method Details
-
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 color -
colorValue
- 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 area -
fill
- set fill color (true
) or stroke color (false
) - Returns:
- current canvas.
-