public class PDResources extends Object implements COSObjectable
| Constructor and Description | 
|---|
PDResources()
Default constructor. 
 | 
PDResources(COSDictionary resourceDictionary)
Prepopulated resources. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
String | 
addFont(PDFont font)
Adds the given font to the resources of the current page. 
 | 
String | 
addFont(PDFont font,
       String fontKey)
Adds the given font to the resources of the current page using the given font key. 
 | 
String | 
addXObject(PDXObject xobject,
          String prefix)
Adds the given XObject to the resources of the current the page. 
 | 
void | 
clear()
Calling this will release all cached information. 
 | 
Map<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. 
 | 
Map<String,PDFont> | 
getFonts()
This will get the map of fonts. 
 | 
Map<String,PDFont> | 
getFonts(Map<String,PDFont> fontCache)
Deprecated. 
 
due to some side effects font caching is no longer supported, use  
getFonts() instead | 
Map<String,PDExtendedGraphicsState> | 
getGraphicsStates()
This will get the map of graphic states. 
 | 
Map<String,PDXObjectImage> | 
getImages()
Deprecated. 
 
use  
getXObjects() instead, as the images map isn't synchronized with the XObjects map. | 
Map<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. 
 | 
Map<String,PDShadingResources> | 
getShadings()
This will get the map of shadings. 
 | 
Map<String,PDXObject> | 
getXObjects()
This will get the map of PDXObjects that are in the resource dictionary. 
 | 
void | 
setColorSpaces(Map<String,PDColorSpace> csValue)
This will set the map of colorspaces. 
 | 
void | 
setFonts(Map<String,PDFont> fontsValue)
This will set the map of fonts. 
 | 
void | 
setGraphicsStates(Map<String,PDExtendedGraphicsState> states)
This will set the map of graphics states. 
 | 
void | 
setPatterns(Map<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(Map<String,PDShadingResources> shadingsValue)
This will set the map of shadings. 
 | 
void | 
setXObjects(Map<String,PDXObject> xobjectsValue)
This will set the map of xobjects. 
 | 
public PDResources()
public PDResources(COSDictionary resourceDictionary)
resourceDictionary - The cos dictionary for this resource.public COSDictionary getCOSDictionary()
public COSBase getCOSObject()
getCOSObject in interface COSObjectablepublic void clear()
public Map<String,PDFont> getFonts(Map<String,PDFont> fontCache) throws IOException
getFonts() insteadfontCache - A map of existing PDFont objects to reuse.IOException - If there is an error getting the fonts.public Map<String,PDFont> getFonts()
public Map<String,PDXObject> getXObjects()
public Map<String,PDXObjectImage> getImages() throws IOException
getXObjects() instead, as the images map isn't synchronized with the XObjects map.IOException - If there is an error writing the picture.public void setFonts(Map<String,PDFont> fontsValue)
fontsValue - The new map of fonts.public void setXObjects(Map<String,PDXObject> xobjectsValue)
xobjectsValue - The new map of xobjects.public Map<String,PDColorSpace> getColorSpaces()
public void setColorSpaces(Map<String,PDColorSpace> csValue)
csValue - The new map of colorspaces.public Map<String,PDExtendedGraphicsState> getGraphicsStates()
public void setGraphicsStates(Map<String,PDExtendedGraphicsState> states)
states - The new map of states.public PDPropertyList getProperties()
public void setProperties(PDPropertyList props)
props - the property listpublic Map<String,PDPatternResources> getPatterns() throws IOException
IOException - If there is an error getting the pattern resources.public void setPatterns(Map<String,PDPatternResources> patternsValue)
patternsValue - The new map of patterns.public Map<String,PDShadingResources> getShadings() throws IOException
IOException - If there is an error getting the shading resources.public void setShadings(Map<String,PDShadingResources> shadingsValue)
shadingsValue - The new map of shadings.public String addFont(PDFont font)
font - the font to be addedpublic String addFont(PDFont font, String fontKey)
font - the font to be addedfontKey - key to used to map to the given fontCopyright © 2002–2017 The Apache Software Foundation. All rights reserved.