Class PDPatternResources
java.lang.Object
org.apache.pdfbox.pdmodel.graphics.pattern.PDPatternResources
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDShadingPatternResources
,PDTilingPatternResources
This represents the resources for a pattern colorspace.
- Version:
- $Revision: 1.0 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.PDPatternResources
(COSDictionary resourceDictionary) Prepopulated pattern resources. -
Method Summary
Modifier and TypeMethodDescriptionstatic PDPatternResources
create
(COSDictionary resourceDictionary) Create the correct PD Model pattern based on the COS base pattern.This will get the underlying dictionary.Convert this standard java object to a COS object.Get the name of the filter.int
This will return the length of the content stream.abstract Paint
getPaint
(int pageHeight) This will return the paint of the pattern.abstract int
This will return the pattern type.getType()
This will return the paint type.void
Sets the filter entry of the encryption dictionary.void
setLength
(int length) This will set the length of the content stream.void
setPaintType
(int paintType) This will set the paint type.void
setPatternType
(int patternType) This will set the pattern type.
-
Field Details
-
TILING_PATTERN
public static final int TILING_PATTERN- See Also:
-
SHADING_PATTERN
public static final int SHADING_PATTERN- See Also:
-
-
Constructor Details
-
PDPatternResources
public PDPatternResources()Default constructor. -
PDPatternResources
Prepopulated pattern resources.- Parameters:
resourceDictionary
- The COSDictionary for this pattern resource.
-
-
Method Details
-
getCOSDictionary
This will get the underlying dictionary.- Returns:
- The dictionary for these pattern resources.
-
getCOSObject
Convert this standard java object to a COS object.- Specified by:
getCOSObject
in interfaceCOSObjectable
- Returns:
- The cos object that matches this Java object.
-
setFilter
Sets the filter entry of the encryption dictionary.- Parameters:
filter
- The filter name.
-
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
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
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:
IOException
- If we are unable to create the PDPattern object.
-
getPaint
This will return the paint of the pattern.- Parameters:
pageHeight
- the height of the current page- Returns:
- the paint of the pattern
- Throws:
IOException
-