Class PDTilingPattern
java.lang.Object
org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern
org.apache.pdfbox.pdmodel.graphics.pattern.PDTilingPattern
- All Implemented Interfaces:
PDContentStream
,COSObjectable
A tiling pattern dictionary.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
paint type 1 = colored tiling pattern.static final int
paint type 2 = uncolored tiling pattern.static final int
tiling type 1 = constant spacing.static final int
tiling type 3 = constant spacing and faster tiling.static final int
tiling type 2 = no distortion.Fields inherited from class org.apache.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern
TYPE_SHADING_PATTERN, TYPE_TILING_PATTERN
-
Constructor Summary
ConstructorsConstructorDescriptionCreates 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
Modifier and TypeMethodDescriptiongetBBox()
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.Returns this stream's content, if any.int
This will return the paint type.int
This will return the pattern type.This will get the resources for this pattern.int
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.final 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, 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
getMatrix
-
Field Details
-
PAINT_COLORED
public static final int PAINT_COLOREDpaint type 1 = colored tiling pattern.- See Also:
-
PAINT_UNCOLORED
public static final int PAINT_UNCOLOREDpaint type 2 = uncolored tiling pattern.- See Also:
-
TILING_CONSTANT_SPACING
public static final int TILING_CONSTANT_SPACINGtiling type 1 = constant spacing.- See Also:
-
TILING_NO_DISTORTION
public static final int TILING_NO_DISTORTIONtiling type 2 = no distortion.- See Also:
-
TILING_CONSTANT_SPACING_FASTER_TILING
public static final int TILING_CONSTANT_SPACING_FASTER_TILINGtiling type 3 = constant spacing and faster tiling.- See Also:
-
-
Constructor Details
-
PDTilingPattern
public PDTilingPattern()Creates a new tiling pattern. -
PDTilingPattern
Creates a new tiling pattern from the given COS dictionary.- Parameters:
dictionary
- The COSDictionary for this pattern.
-
PDTilingPattern
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 classPDAbstractPattern
- Returns:
- The pattern type
-
setPaintType
public void setPaintType(int paintType) This will set the paint type.- Overrides:
setPaintType
in classPDAbstractPattern
- 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
-
getContents
Description copied from interface:PDContentStream
Returns this stream's content, if any.- Specified by:
getContents
in interfacePDContentStream
- Returns:
- An InputStream or null.
- Throws:
IOException
- If the stream could not be read
-
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 interfacePDContentStream
- Returns:
- The resources for this pattern.
-
setResources
This will set the resources for this pattern.- Parameters:
resources
- The new resources for this pattern.
-
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 interfacePDContentStream
- Returns:
- The BBox of the pattern.
-
setBBox
This will set the BBox (bounding box) for this Pattern.- Parameters:
bbox
- The new BBox for this Pattern.
-