org.apache.pdfbox.pdmodel.graphics.pattern

## 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 Summary

Fields
`static int` `PAINT_COLORED` paint type 1 = colored tiling pattern.
`static int` `PAINT_UNCOLORED` paint type 2 = uncolored tiling pattern.
`static int` `TILING_CONSTANT_SPACING` tiling type 1 = constant spacing.
`static int` `TILING_CONSTANT_SPACING_FASTER_TILING` tiling type 3 = constant spacing and faster tiling.
`static int` `TILING_NO_DISTORTION` tiling type 2 = no distortion.

### Fields inherited from class org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern

`TYPE_SHADING_PATTERN, TYPE_TILING_PATTERN`

### Constructor Summary

Constructors
Constructor and Description
`PDTilingPattern()` Creates a new tiling pattern.
`PDTilingPattern(COSDictionary dictionary)` Creates a new tiling pattern from the given COS dictionary.
`PDTilingPattern(COSDictionary dictionary, ResourceCache resourceCache)` Creates a new tiling pattern from the given COS dictionary.

### Method Summary

All Methods Instance Methods Concrete Methods
`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.
`InputStream` `getContents()` Returns this stream's content, if any.
`org.apache.pdfbox.io.RandomAccessRead` `getContentsForRandomAccess()` Returns this stream's content, if any.
`PDStream` `getContentStream()`
`int` `getPaintType()` This will return the paint type.
`int` `getPatternType()` This will return the pattern type.
`PDResources` `getResources()` This will get the resources for this pattern.
`int` `getTilingType()` This will return the tiling type.
`float` `getXStep()` This will return the XStep value.
`float` `getYStep()` This will return the YStep value.
`void` `setBBox(PDRectangle bbox)` This will set the BBox (bounding box) for this Pattern.
`void` `setPaintType(int paintType)` This will set the paint type.
`void` `setResources(PDResources resources)` This will set the resources for this pattern.
`void` `setTilingType(int tilingType)` This will set the tiling type.
`void` `setXStep(float xStep)` This will set the XStep value.
`void` `setYStep(float yStep)` This will set the YStep value.

### Methods inherited from class org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern

`create, getCOSObject, getMatrix, getType, setMatrix, setPatternType`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface org.apache.pdfbox.contentstream.PDContentStream

`getContentsForStreamParsing, getMatrix`

### Field Detail

#### PAINT_COLORED

    public static final int PAINT_COLORED

paint type 1 = colored tiling pattern.

See Also:
  Constant Field Values

#### PAINT_UNCOLORED

    public static final int PAINT_UNCOLORED

paint type 2 = uncolored tiling pattern.

See Also:
  Constant Field Values

#### TILING_CONSTANT_SPACING

    public static final int TILING_CONSTANT_SPACING

tiling type 1 = constant spacing.

See Also:
  Constant Field Values

#### TILING_NO_DISTORTION

    public static final int TILING_NO_DISTORTION

tiling type 2 = no distortion.

See Also:
  Constant Field Values

#### TILING_CONSTANT_SPACING_FASTER_TILING

    public static final int TILING_CONSTANT_SPACING_FASTER_TILING

tiling type 3 = constant spacing and faster tiling.

See Also:
  Constant Field Values

### Constructor Detail

#### 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 Detail

#### 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

#### getContentsForRandomAccess

    public org.apache.pdfbox.io.RandomAccessRead getContentsForRandomAccess()
                                                                     throws IOException

Description copied from interface: `PDContentStream`
Returns this stream's content, if any.

Specified by:
  `getContentsForRandomAccess` in interface `PDContentStream`
Returns:
  A RandomAccessRead or null.
Throws:
  `IOException` - If the content 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.