Class PDPatternResources
- java.lang.Object
-
- org.apache.pdfbox.pdmodel.graphics.pattern.PDPatternResources
-
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDShadingPatternResources,PDTilingPatternResources
public abstract class PDPatternResources extends java.lang.Object implements COSObjectable
This represents the resources for a pattern colorspace.- Version:
- $Revision: 1.0 $
-
-
Field Summary
Fields Modifier and Type Field Description static intSHADING_PATTERNstatic intTILING_PATTERN
-
Constructor Summary
Constructors Constructor Description PDPatternResources()Default constructor.PDPatternResources(COSDictionary resourceDictionary)Prepopulated pattern resources.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static PDPatternResourcescreate(COSDictionary resourceDictionary)Create the correct PD Model pattern based on the COS base pattern.COSDictionarygetCOSDictionary()This will get the underlying dictionary.COSBasegetCOSObject()Convert this standard java object to a COS object.java.lang.StringgetFilter()Get the name of the filter.intgetLength()This will return the length of the content stream.abstract java.awt.PaintgetPaint(int pageHeight)This will return the paint of the pattern.abstract intgetPatternType()This will return the pattern type.java.lang.StringgetType()This will return the paint type.voidsetFilter(java.lang.String filter)Sets the filter entry of the encryption dictionary.voidsetLength(int length)This will set the length of the content stream.voidsetPaintType(int paintType)This will set the paint type.voidsetPatternType(int patternType)This will set the pattern type.
-
-
-
Field Detail
-
TILING_PATTERN
public static final int TILING_PATTERN
- See Also:
- Constant Field Values
-
SHADING_PATTERN
public static final int SHADING_PATTERN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PDPatternResources
public PDPatternResources()
Default constructor.
-
PDPatternResources
public PDPatternResources(COSDictionary resourceDictionary)
Prepopulated pattern resources.- Parameters:
resourceDictionary- The COSDictionary for this pattern resource.
-
-
Method Detail
-
getCOSDictionary
public COSDictionary getCOSDictionary()
This will get the underlying dictionary.- Returns:
- The dictionary for these pattern resources.
-
getCOSObject
public COSBase getCOSObject()
Convert this standard java object to a COS object.- Specified by:
getCOSObjectin interfaceCOSObjectable- Returns:
- The cos object that matches this Java object.
-
setFilter
public void setFilter(java.lang.String filter)
Sets the filter entry of the encryption dictionary.- Parameters:
filter- The filter name.
-
getFilter
public java.lang.String getFilter()
Get the name of the filter.- Returns:
- The filter name contained in this encryption dictionary.
-
setLength
public void setLength(int length)
This will set the length of the content stream.- Parameters:
length- The new stream length.
-
getLength
public int getLength()
This will return the length of the content stream.- Returns:
- The length of the content stream
-
setPaintType
public void setPaintType(int paintType)
This will set the paint type.- Parameters:
paintType- The new paint type.
-
getType
public java.lang.String getType()
This will return the paint type.- Returns:
- The type of object that this is.
-
setPatternType
public void setPatternType(int patternType)
This will set the pattern type.- Parameters:
patternType- The new pattern type.
-
getPatternType
public abstract int getPatternType()
This will return the pattern type.- Returns:
- The pattern type
-
create
public static PDPatternResources create(COSDictionary resourceDictionary) throws java.io.IOException
Create the correct PD Model pattern based on the COS base pattern.- Parameters:
resourceDictionary- the COS pattern dictionary- Returns:
- the newly created pattern resources object
- Throws:
java.io.IOException- If we are unable to create the PDPattern object.
-
getPaint
public abstract java.awt.Paint getPaint(int pageHeight) throws java.io.IOExceptionThis will return the paint of the pattern.- Parameters:
pageHeight- the height of the current page- Returns:
- the paint of the pattern
- Throws:
java.io.IOException
-
-