|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pdfbox.pdmodel.PDResources
public class PDResources
This represents a set of resources available at the page/pages/stream level.
Constructor Summary | |
---|---|
PDResources()
Default constructor. |
|
PDResources(COSDictionary resourceDictionary)
Prepopulated resources. |
Method Summary | |
---|---|
java.lang.String |
addFont(PDFont font)
Adds the given font to the resources of the current page. |
java.lang.String |
addFont(PDFont font,
java.lang.String fontKey)
Adds the given font to the resources of the current page using the given font key. |
java.lang.String |
addXObject(PDXObject xobject,
java.lang.String prefix)
Adds the given XObject to the resources of the current the page. |
void |
clear()
Calling this will release all cached information. |
java.util.Map<java.lang.String,PDColorSpace> |
getColorSpaces()
This will get the map of colorspaces. |
COSDictionary |
getCOSDictionary()
This will get the underlying dictionary. |
COSBase |
getCOSObject()
Convert this standard java object to a COS object. |
java.util.Map<java.lang.String,PDFont> |
getFonts()
This will get the map of fonts. |
java.util.Map<java.lang.String,PDFont> |
getFonts(java.util.Map<java.lang.String,PDFont> fontCache)
Deprecated. due to some side effects font caching is no longer supported, use getFonts() instead |
java.util.Map<java.lang.String,PDExtendedGraphicsState> |
getGraphicsStates()
This will get the map of graphic states. |
java.util.Map<java.lang.String,PDXObjectImage> |
getImages()
This will get the map of images. |
java.util.Map<java.lang.String,PDPatternResources> |
getPatterns()
This will get the map of patterns. |
PDPropertyList |
getProperties()
Returns the dictionary mapping resource names to property list dictionaries for marked content. |
java.util.Map<java.lang.String,PDShadingResources> |
getShadings()
This will get the map of shadings. |
java.util.Map<java.lang.String,PDXObject> |
getXObjects()
This will get the map of PDXObjects that are in the resource dictionary. |
void |
setColorSpaces(java.util.Map<java.lang.String,PDColorSpace> csValue)
This will set the map of colorspaces. |
void |
setFonts(java.util.Map<java.lang.String,PDFont> fontsValue)
This will set the map of fonts. |
void |
setGraphicsStates(java.util.Map<java.lang.String,PDExtendedGraphicsState> states)
This will set the map of graphics states. |
void |
setPatterns(java.util.Map<java.lang.String,PDPatternResources> patternsValue)
This will set the map of patterns. |
void |
setProperties(PDPropertyList props)
Sets the dictionary mapping resource names to property list dictionaries for marked content. |
void |
setShadings(java.util.Map<java.lang.String,PDShadingResources> shadingsValue)
This will set the map of shadings. |
void |
setXObjects(java.util.Map<java.lang.String,PDXObject> xobjectsValue)
This will set the map of xobjects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PDResources()
public PDResources(COSDictionary resourceDictionary)
resourceDictionary
- The cos dictionary for this resource.Method Detail |
---|
public COSDictionary getCOSDictionary()
public COSBase getCOSObject()
getCOSObject
in interface COSObjectable
public void clear()
public java.util.Map<java.lang.String,PDFont> getFonts(java.util.Map<java.lang.String,PDFont> fontCache) throws java.io.IOException
getFonts()
instead
fontCache
- A map of existing PDFont objects to reuse.
java.io.IOException
- If there is an error getting the fonts.public java.util.Map<java.lang.String,PDFont> getFonts()
public java.util.Map<java.lang.String,PDXObject> getXObjects()
public java.util.Map<java.lang.String,PDXObjectImage> getImages() throws java.io.IOException
java.io.IOException
- If there is an error writing the picture.public void setFonts(java.util.Map<java.lang.String,PDFont> fontsValue)
fontsValue
- The new map of fonts.public void setXObjects(java.util.Map<java.lang.String,PDXObject> xobjectsValue)
xobjectsValue
- The new map of xobjects.public java.util.Map<java.lang.String,PDColorSpace> getColorSpaces()
public void setColorSpaces(java.util.Map<java.lang.String,PDColorSpace> csValue)
csValue
- The new map of colorspaces.public java.util.Map<java.lang.String,PDExtendedGraphicsState> getGraphicsStates()
public void setGraphicsStates(java.util.Map<java.lang.String,PDExtendedGraphicsState> states)
states
- The new map of states.public PDPropertyList getProperties()
public void setProperties(PDPropertyList props)
props
- the property listpublic java.util.Map<java.lang.String,PDPatternResources> getPatterns() throws java.io.IOException
java.io.IOException
- If there is an error getting the pattern resources.public void setPatterns(java.util.Map<java.lang.String,PDPatternResources> patternsValue)
patternsValue
- The new map of patterns.public java.util.Map<java.lang.String,PDShadingResources> getShadings() throws java.io.IOException
java.io.IOException
- If there is an error getting the shading resources.public void setShadings(java.util.Map<java.lang.String,PDShadingResources> shadingsValue)
shadingsValue
- The new map of shadings.public java.lang.String addFont(PDFont font)
font
- the font to be added
public java.lang.String addFont(PDFont font, java.lang.String fontKey)
font
- the font to be addedfontKey
- key to used to map to the given font
public java.lang.String addXObject(PDXObject xobject, java.lang.String prefix)
xobject
- the XObject to be addedprefix
- the prefix to be used for the name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |