Class PdfPatternPainter

    • Field Detail

      • xstep

        float xstep
      • ystep

        float ystep
      • stencil

        boolean stencil
    • Constructor Detail

      • PdfPatternPainter

        private PdfPatternPainter()
        Creates a PdfPattern.
      • PdfPatternPainter

        PdfPatternPainter​(PdfWriter wr)
        Creates new PdfPattern
        Parameters:
        wr - the PdfWriter
    • Method Detail

      • 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

        public PdfPattern getPattern()
        Gets the stream representing this pattern
        Returns:
        the stream representing this pattern
      • getPattern

        public PdfPattern getPattern​(int compressionLevel)
        Gets the stream representing this pattern
        Parameters:
        compressionLevel - the compression level of the stream
        Returns:
        the stream representing this pattern
        Since:
        2.1.3
      • getDuplicate

        public PdfContentByte getDuplicate()
        Gets a duplicate of this PdfPatternPainter. All the members are copied by reference but the buffer stays different.
        Overrides:
        getDuplicate in class PdfTemplate
        Returns:
        a copy of this PdfPatternPainter
      • getDefaultColor

        public BaseColor getDefaultColor()
        Returns the default color of the pattern.
        Returns:
        a BaseColor
      • setGrayFill

        public void setGrayFill​(float gray)
        Description copied from class: PdfContentByte
        Changes 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:
        setGrayFill in class PdfContentByte
        Parameters:
        gray - a value between 0 (black) and 1 (white)
        See Also:
        PdfContentByte.setGrayFill(float)
      • setGrayStroke

        public void setGrayStroke​(float gray)
        Description copied from class: PdfContentByte
        Changes 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:
        setGrayStroke in class PdfContentByte
        Parameters:
        gray - a value between 0 (black) and 1 (white)
        See Also:
        PdfContentByte.setGrayStroke(float)
      • setRGBColorFillF

        public void setRGBColorFillF​(float red,
                                     float green,
                                     float blue)
        Description copied from class: PdfContentByte
        Changes 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:
        setRGBColorFillF in class PdfContentByte
        Parameters:
        red - the intensity of red. A value between 0 and 1
        green - the intensity of green. A value between 0 and 1
        blue - the intensity of blue. A value between 0 and 1
        See Also:
        PdfContentByte.setRGBColorFillF(float, float, float)
      • setRGBColorStrokeF

        public void setRGBColorStrokeF​(float red,
                                       float green,
                                       float blue)
        Description copied from class: PdfContentByte
        Changes 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:
        setRGBColorStrokeF in class PdfContentByte
        Parameters:
        red - the intensity of red. A value between 0 and 1
        green - the intensity of green. A value between 0 and 1
        blue - the intensity of blue. A value between 0 and 1
        See Also:
        PdfContentByte.setRGBColorStrokeF(float, float, float)
      • setCMYKColorFillF

        public void setCMYKColorFillF​(float cyan,
                                      float magenta,
                                      float yellow,
                                      float black)
        Description copied from class: PdfContentByte
        Changes 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:
        setCMYKColorFillF in class PdfContentByte
        Parameters:
        cyan - the intensity of cyan. A value between 0 and 1
        magenta - the intensity of magenta. A value between 0 and 1
        yellow - the intensity of yellow. A value between 0 and 1
        black - the intensity of black. A value between 0 and 1
        See Also:
        PdfContentByte.setCMYKColorFillF(float, float, float, float)
      • setCMYKColorStrokeF

        public void setCMYKColorStrokeF​(float cyan,
                                        float magenta,
                                        float yellow,
                                        float black)
        Description copied from class: PdfContentByte
        Changes 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:
        setCMYKColorStrokeF in class PdfContentByte
        Parameters:
        cyan - the intensity of cyan. A value between 0 and 1
        magenta - the intensity of magenta. A value between 0 and 1
        yellow - the intensity of yellow. A value between 0 and 1
        black - the intensity of black. A value between 0 and 1
        See Also:
        PdfContentByte.setCMYKColorStrokeF(float, float, float, float)
      • addImage

        public void addImage​(Image image,
                             float a,
                             float b,
                             float c,
                             float d,
                             float e,
                             float f)
                      throws DocumentException
        Description copied from class: PdfContentByte
        Adds an Image to the page. The positioning of the Image is done with the transformation matrix. To position an image at (x,y) use addImage(image, image_width, 0, 0, image_height, x, y).
        Overrides:
        addImage in class PdfContentByte
        Parameters:
        image - the Image object
        a - an element of the transformation matrix
        b - an element of the transformation matrix
        c - an element of the transformation matrix
        d - an element of the transformation matrix
        e - an element of the transformation matrix
        f - an element of the transformation matrix
        Throws:
        DocumentException - on error
        See Also:
        PdfContentByte.addImage(com.itextpdf.text.Image, float, float, float, float, float, float)
      • setCMYKColorFill

        public void setCMYKColorFill​(int cyan,
                                     int magenta,
                                     int yellow,
                                     int black)
        Description copied from class: PdfContentByte
        Changes 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:
        setCMYKColorFill in class PdfContentByte
        Parameters:
        cyan - the intensity of cyan
        magenta - the intensity of magenta
        yellow - the intensity of yellow
        black - the intensity of black
        See Also:
        PdfContentByte.setCMYKColorFill(int, int, int, int)
      • setCMYKColorStroke

        public void setCMYKColorStroke​(int cyan,
                                       int magenta,
                                       int yellow,
                                       int black)
        Description copied from class: PdfContentByte
        Changes 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 (minimum intensity) and 1 (maximum intensity). This method however accepts only integers between 0x00 and 0xFF.
        Overrides:
        setCMYKColorStroke in class PdfContentByte
        Parameters:
        cyan - the intensity of red
        magenta - the intensity of green
        yellow - the intensity of blue
        black - the intensity of black
        See Also:
        PdfContentByte.setCMYKColorStroke(int, int, int, int)
      • setRGBColorFill

        public void setRGBColorFill​(int red,
                                    int green,
                                    int blue)
        Description copied from class: PdfContentByte
        Changes 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 (minimum intensity) and 1 (maximum intensity). This method however accepts only integers between 0x00 and 0xFF.

        Overrides:
        setRGBColorFill in class PdfContentByte
        Parameters:
        red - the intensity of red
        green - the intensity of green
        blue - the intensity of blue
        See Also:
        PdfContentByte.setRGBColorFill(int, int, int)
      • setRGBColorStroke

        public void setRGBColorStroke​(int red,
                                      int green,
                                      int blue)
        Description copied from class: PdfContentByte
        Changes 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 (minimum intensity) and 1 (maximum intensity). This method however accepts only integers between 0x00 and 0xFF.
        Overrides:
        setRGBColorStroke in class PdfContentByte
        Parameters:
        red - the intensity of red
        green - the intensity of green
        blue - the intensity of blue
        See Also:
        PdfContentByte.setRGBColorStroke(int, int, int)
      • checkNoColor

        void checkNoColor()