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.
  • Constructor Details

    • PdfPatternCanvas

      public PdfPatternCanvas (PdfStream contentStream, PdfResources resources, PdfDocument document)
      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

      public PdfPatternCanvas (PdfPattern.Tiling pattern, PdfDocument document)
      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 class PdfCanvas
      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.