org.icepdf.core.pobjects
Class Resources

java.lang.Object
  extended by org.icepdf.core.pobjects.Dictionary
      extended by org.icepdf.core.pobjects.Resources

public class Resources
extends Dictionary

A resource is a dictionary type as defined by the PDF specification. It can contain fonts, xobjects, colorspaces, patterns, shading and external graphic states.

Since:
1.0

Field Summary
static Name COLORSPACE_KEY
           
static Name EXTGSTATE_KEY
           
static Name FONT_KEY
           
static Name PATTERN_KEY
           
static Name PROPERTIES_KEY
           
static Name SHADING_KEY
           
static Name XOBJECT_KEY
           
 
Fields inherited from class org.icepdf.core.pobjects.Dictionary
entries, FORM_TYPE_KEY, inited, isDeleted, isNew, LENGTH_KEY, library, SUBTYPE_KEY, TYPE_KEY
 
Constructor Summary
Resources(Library l, java.util.HashMap h)
           
 
Method Summary
 PColorSpace getColorSpace(java.lang.Object o)
           
 ExtGState getExtGState(Name namedReference)
          Returns the ExtGState object which has the specified reference name.
 Font getFont(Name s)
           
 Form getForm(Name nameReference)
          Gets the Form XObject specified by the named reference.
 java.awt.Image getImage(Name s, java.awt.Color fill)
           
 ImageStream getImageStream(Name s)
           
 Pattern getPattern(Name name)
          Retrieves a Pattern object given the named resource.
 OptionalContents getPropertyEntry(Name key)
          Looks for the specified key in the Properties dictionary.
 ShadingPattern getShading(Name name)
          Gets the shadding pattern based on a shading dictionary name, similar to getPattern but is only called for the 'sh' token.
 boolean isForm(Name s)
           
 boolean isShading()
          Checks to see if the Shading key has value in this resource dictionary.
 
Methods inherited from class org.icepdf.core.pobjects.Dictionary
getEntries, getFloat, getInt, getLibrary, getNumber, getObject, getPObjectReference, init, isDeleted, isNew, setDeleted, setNew, setPObjectReference, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COLORSPACE_KEY

public static final Name COLORSPACE_KEY

FONT_KEY

public static final Name FONT_KEY

XOBJECT_KEY

public static final Name XOBJECT_KEY

PATTERN_KEY

public static final Name PATTERN_KEY

SHADING_KEY

public static final Name SHADING_KEY

EXTGSTATE_KEY

public static final Name EXTGSTATE_KEY

PROPERTIES_KEY

public static final Name PROPERTIES_KEY
Constructor Detail

Resources

public Resources(Library l,
                 java.util.HashMap h)
Parameters:
l -
h -
Method Detail

getColorSpace

public PColorSpace getColorSpace(java.lang.Object o)
Parameters:
o -
Returns:

getFont

public Font getFont(Name s)
Parameters:
s -
Returns:

getImage

public java.awt.Image getImage(Name s,
                               java.awt.Color fill)
Parameters:
s -
fill -
Returns:

getImageStream

public ImageStream getImageStream(Name s)

isForm

public boolean isForm(Name s)
Parameters:
s -
Returns:

getForm

public Form getForm(Name nameReference)
Gets the Form XObject specified by the named reference.

Parameters:
nameReference - name of resourse to retreive.
Returns:
if the named reference is found return it, otherwise return null;

getPattern

public Pattern getPattern(Name name)
Retrieves a Pattern object given the named resource. This can be call for a fill, text fill or do image mask.

Parameters:
name - of object to find.
Returns:
tiling or shading type pattern object. If not constructor is found, then null is returned.

getShading

public ShadingPattern getShading(Name name)
Gets the shadding pattern based on a shading dictionary name, similar to getPattern but is only called for the 'sh' token.

Parameters:
name - name of shading dictionary
Returns:
associated shading pattern if any.

getExtGState

public ExtGState getExtGState(Name namedReference)
Returns the ExtGState object which has the specified reference name.

Parameters:
namedReference - name of ExtGState object to try and find.
Returns:
ExtGState which contains the named references ExtGState attrbutes, if the namedReference could not be found null is returned.

getPropertyEntry

public OptionalContents getPropertyEntry(Name key)
Looks for the specified key in the Properties dictionary. If the dictionary and corresponding value is found the object is returned otherwise null.

Parameters:
key - key to find a value of in the Properties dictionary.
Returns:
key value if found, null otherwise.

isShading

public boolean isShading()
Checks to see if the Shading key has value in this resource dictionary.

Returns:
true if there are shading values, false otherwise.