Class PDTilingPattern

java.lang.Object
org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern
org.apache.pdfbox.pdmodel.graphics.pattern.PDTilingPattern
All Implemented Interfaces:
PDContentStream, COSObjectable

public class PDTilingPattern extends PDAbstractPattern implements PDContentStream
A tiling pattern dictionary.
  • Field Details

    • PAINT_COLORED

      public static final int PAINT_COLORED
      paint type 1 = colored tiling pattern.
      See Also:
    • PAINT_UNCOLORED

      public static final int PAINT_UNCOLORED
      paint type 2 = uncolored tiling pattern.
      See Also:
    • TILING_CONSTANT_SPACING

      public static final int TILING_CONSTANT_SPACING
      tiling type 1 = constant spacing.
      See Also:
    • TILING_NO_DISTORTION

      public static final int TILING_NO_DISTORTION
      tiling type 2 = no distortion.
      See Also:
    • TILING_CONSTANT_SPACING_FASTER_TILING

      public static final int TILING_CONSTANT_SPACING_FASTER_TILING
      tiling type 3 = constant spacing and faster tiling.
      See Also:
    • resourceCache

      private final ResourceCache resourceCache
  • Constructor Details

    • PDTilingPattern

      public PDTilingPattern()
      Creates a new tiling pattern.
    • PDTilingPattern

      public PDTilingPattern(COSDictionary dictionary)
      Creates a new tiling pattern from the given COS dictionary.
      Parameters:
      dictionary - The COSDictionary for this pattern.
    • PDTilingPattern

      public PDTilingPattern(COSDictionary dictionary, ResourceCache resourceCache)
      Creates a new tiling pattern from the given COS dictionary.
      Parameters:
      dictionary - The COSDictionary for this pattern.
      resourceCache - The resource cache, may be null
  • Method Details

    • getPatternType

      public int getPatternType()
      Description copied from class: PDAbstractPattern
      This will return the pattern type.
      Specified by:
      getPatternType in class PDAbstractPattern
      Returns:
      The pattern type
    • setPaintType

      public void setPaintType(int paintType)
      This will set the paint type.
      Overrides:
      setPaintType in class PDAbstractPattern
      Parameters:
      paintType - The new paint type.
    • getPaintType

      public int getPaintType()
      This will return the paint type.
      Returns:
      The paint type
    • setTilingType

      public void setTilingType(int tilingType)
      This will set the tiling type.
      Parameters:
      tilingType - The new tiling type.
    • getTilingType

      public int getTilingType()
      This will return the tiling type.
      Returns:
      The tiling type
    • setXStep

      public void setXStep(float xStep)
      This will set the XStep value.
      Parameters:
      xStep - The new XStep value.
    • getXStep

      public float getXStep()
      This will return the XStep value.
      Returns:
      The XStep value
    • setYStep

      public void setYStep(float yStep)
      This will set the YStep value.
      Parameters:
      yStep - The new YStep value.
    • getYStep

      public float getYStep()
      This will return the YStep value.
      Returns:
      The YStep value
    • getContentStream

      public PDStream getContentStream()
    • getContents

      public InputStream getContents() throws IOException
      Description copied from interface: PDContentStream
      Returns this stream's content, if any.
      Specified by:
      getContents in interface PDContentStream
      Returns:
      An InputStream or null.
      Throws:
      IOException - If the stream could not be read
    • getResources

      public PDResources getResources()
      This will get the resources for this pattern. This will return null if no resources are available at this level.
      Specified by:
      getResources in interface PDContentStream
      Returns:
      The resources for this pattern.
    • setResources

      public final void setResources(PDResources resources)
      This will set the resources for this pattern.
      Parameters:
      resources - The new resources for this pattern.
    • getBBox

      public PDRectangle getBBox()
      An array of four numbers in the form coordinate system (see below), giving the coordinates of the left, bottom, right, and top edges, respectively, of the pattern's bounding box.
      Specified by:
      getBBox in interface PDContentStream
      Returns:
      The BBox of the pattern.
    • setBBox

      public void setBBox(PDRectangle bbox)
      This will set the BBox (bounding box) for this Pattern.
      Parameters:
      bbox - The new BBox for this Pattern.