Class PDTilingPattern
- java.lang.Object
-
- com.tom_roush.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern
-
- com.tom_roush.pdfbox.pdmodel.graphics.pattern.PDTilingPattern
-
- All Implemented Interfaces:
PDContentStream,COSObjectable
public class PDTilingPattern extends PDAbstractPattern implements PDContentStream
A tiling pattern dictionary.
-
-
Field Summary
Fields Modifier and Type Field Description static intPAINT_COLOREDpaint type 1 = colored tiling pattern.static intPAINT_UNCOLOREDpaint type 2 = uncolored tiling pattern.static intTILING_CONSTANT_SPACINGtiling type 1 = constant spacing.static intTILING_CONSTANT_SPACING_FASTER_TILINGtiling type 3 = constant spacing and faster tiling.static intTILING_NO_DISTORTIONtiling type 2 = no distortion.-
Fields inherited from class com.tom_roush.pdfbox.pdmodel.graphics.pattern.PDAbstractPattern
TYPE_SHADING_PATTERN, TYPE_TILING_PATTERN
-
-
Constructor Summary
Constructors Constructor 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 Modifier and Type Method Description PDRectanglegetBBox()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.InputStreamgetContents()Returns this stream's content, if any.PDStreamgetContentStream()intgetPaintType()This will return the paint type.intgetPatternType()This will return the pattern type.PDResourcesgetResources()This will get the resources for this pattern.intgetTilingType()This will return the tiling type.floatgetXStep()This will return the XStep value.floatgetYStep()This will return the YStep value.voidsetBBox(PDRectangle bbox)This will set the BBox (bounding box) for this Pattern.voidsetPaintType(int paintType)This will set the paint type.voidsetResources(PDResources resources)This will set the resources for this pattern.voidsetTilingType(int tilingType)This will set the tiling type.voidsetXStep(float xStep)This will set the XStep value.voidsetYStep(float yStep)This will set the YStep value.-
Methods inherited from class com.tom_roush.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 com.tom_roush.pdfbox.contentstream.PDContentStream
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:PDAbstractPatternThis will return the pattern type.- Specified by:
getPatternTypein classPDAbstractPattern- Returns:
- The pattern type
-
setPaintType
public void setPaintType(int paintType)
This will set the paint type.- Overrides:
setPaintTypein 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
public PDStream getContentStream()
-
getContents
public InputStream getContents() throws IOException
Description copied from interface:PDContentStreamReturns this stream's content, if any.- Specified by:
getContentsin interfacePDContentStream- 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:
getResourcesin interfacePDContentStream- 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:
getBBoxin interfacePDContentStream- 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.
-
-