intarsys PDF library API

de.intarsys.pdf.pd
Class PDResources

java.lang.Object
  extended by de.intarsys.pdf.cos.COSBasedObject
      extended by de.intarsys.pdf.pd.PDObject
          extended by de.intarsys.pdf.pd.PDResources
All Implemented Interfaces:
ICOSObjectListener, IAttributeSupport

public class PDResources
extends PDObject

The implementation of a resource dictionary.

The resource dictionary holds the references to indirect objects that are use within a CSContent. From the CSContent, these objects are referenced using the key under which they are stored in the dictionary.


Nested Class Summary
static class PDResources.MetaClass
          The meta class implementation
 
Field Summary
static COSName CN_RT_ColorSpace
           
static COSName CN_RT_Encoding
           
static COSName CN_RT_ExtGState
          the resource types in a resource dictionaries
static COSName CN_RT_Font
           
static COSName CN_RT_Pattern
           
static COSName CN_RT_ProcSet
           
static COSName CN_RT_Properties
           
static COSName CN_RT_Shading
           
static COSName CN_RT_XObject
           
static PDResources.MetaClass META
          The meta class instance
 
Fields inherited from class de.intarsys.pdf.pd.PDObject
DK_Subtype, DK_Type
 
Method Summary
 void addColorSpaceResource(COSName name, PDColorSpace colorSpace)
           
 void addExtGStateResource(COSName name, PDExtGState extGState)
           
 void addFontResource(COSName name, PDFont font)
           
 void addPatternResource(COSName name, PDPattern pattern)
           
 void addResource(COSName resourceType, COSName name, PDObject object)
           
 void addShadingResource(COSName name, PDShading shading)
           
 void addXObjectResource(COSName name, PDXObject object)
           
 void cosAddResource(COSName resourceType, COSName resourceName, COSObject resource)
           
 COSName cosCreateResource(COSName resourceType, COSObject resource)
           
 COSObject cosGetResource(COSName resourceType, COSName resourceName)
           
 COSDictionary cosGetResources(COSName resourceType)
           
 COSName createColorSpaceResource(PDColorSpace colorSpace)
          Return the name of a ColorSpace resource within the resource dictionary.
 COSName createExtGStateResource(PDExtGState gstate)
          Return the name of a ExtGState resource within the resource dictionary.
 COSName createFontResource(PDFont font)
          Return the name of the font resource within this resource dictionary.
 COSName createResource(COSName resourceType, PDObject object)
          Return the name of a new resource of selected resource type within the resource dictionary.
 COSName createShadingResource(PDShading shading)
          Return the name of a shading resource within the resource dictionary.
 COSName createXObjectResource(PDXObject xobject)
          Return the name of a XObject resource within the resource dictionary.
 PDColorSpace getColorSpaceResource(COSName name)
          A named ColorSpace resource from the resource dictionary.
 PDExtGState getExtGStateResource(COSName name)
          Return a named ExtGState resource from the resource dictionary.
 PDFont getFontResource(COSName name)
          Return a named font resource.
 PDPattern getPatternResource(COSName name)
          Return a named Pattern resource from the resource dictionary.
 PDObject getResource(COSName resourceType, PDObject.MetaClass metaClass, COSName name)
          Return a named resource from the resource dictionary.
 PDShading getShadingResource(COSName name)
          Return a named Pattern resource from the resource dictionary.
 PDXObject getXObjectResource(COSName name)
          Return a named XObject resource from the resource dictionary.
 void invalidateCaches()
          Invalidate all local caches as the base object may have changed.
 
Methods inherited from class de.intarsys.pdf.pd.PDObject
cosGetFieldDescendant, cosGetFieldInheritable, cosGetFieldInherited, cosGetSubtype, cosGetType, cosRemoveFieldInheritable, cosSetFieldInheritable, cosSetSubtype, cosSetType, getDoc, getGenericChildren, getGenericParent, setGenericParent, toString
 
Methods inherited from class de.intarsys.pdf.cos.COSBasedObject
changed, cosGetArray, cosGetDict, cosGetDoc, cosGetField, cosGetObject, cosGetStream, cosHasField, cosRemoveField, cosSetField, getAttribute, getFieldBoolean, getFieldDate, getFieldFixed, getFieldFixedArray, getFieldInt, getFieldMLString, getFieldString, removeAttribute, setAttribute, setFieldBoolean, setFieldFixed, setFieldInt, setFieldMLString, setFieldName, setFieldObject, setFieldString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CN_RT_ColorSpace

public static final COSName CN_RT_ColorSpace

CN_RT_Encoding

public static final COSName CN_RT_Encoding

CN_RT_ExtGState

public static final COSName CN_RT_ExtGState
the resource types in a resource dictionaries


CN_RT_Font

public static final COSName CN_RT_Font

CN_RT_Pattern

public static final COSName CN_RT_Pattern

CN_RT_ProcSet

public static final COSName CN_RT_ProcSet

CN_RT_Properties

public static final COSName CN_RT_Properties

CN_RT_Shading

public static final COSName CN_RT_Shading

CN_RT_XObject

public static final COSName CN_RT_XObject

META

public static final PDResources.MetaClass META
The meta class instance

Method Detail

addColorSpaceResource

public void addColorSpaceResource(COSName name,
                                  PDColorSpace colorSpace)

addExtGStateResource

public void addExtGStateResource(COSName name,
                                 PDExtGState extGState)

addFontResource

public void addFontResource(COSName name,
                            PDFont font)

addPatternResource

public void addPatternResource(COSName name,
                               PDPattern pattern)

addResource

public void addResource(COSName resourceType,
                        COSName name,
                        PDObject object)

addShadingResource

public void addShadingResource(COSName name,
                               PDShading shading)

addXObjectResource

public void addXObjectResource(COSName name,
                               PDXObject object)

cosAddResource

public void cosAddResource(COSName resourceType,
                           COSName resourceName,
                           COSObject resource)

cosCreateResource

public COSName cosCreateResource(COSName resourceType,
                                 COSObject resource)

cosGetResource

public COSObject cosGetResource(COSName resourceType,
                                COSName resourceName)

cosGetResources

public COSDictionary cosGetResources(COSName resourceType)

createColorSpaceResource

public COSName createColorSpaceResource(PDColorSpace colorSpace)
Return the name of a ColorSpace resource within the resource dictionary.

A new entry is created if the resource is not found.

Parameters:
colorSpace - The colorSpace to lookup.
Returns:
the name of a ColorSpace resource within the resource dictionary.

createExtGStateResource

public COSName createExtGStateResource(PDExtGState gstate)
Return the name of a ExtGState resource within the resource dictionary.

A new entry is created if the resource is not found.

Parameters:
gstate - The gstate to lookup.
Returns:
the name of a ExtGState resource within the resource dictionary.

createFontResource

public COSName createFontResource(PDFont font)
Return the name of the font resource within this resource dictionary.

A new entry is created if the resource is not found.

Parameters:
font - The font whose name is looked up.
Returns:
the name of the font resource within this resource dictionary.

createResource

public COSName createResource(COSName resourceType,
                              PDObject object)
Return the name of a new resource of selected resource type within the resource dictionary.

A new entry is created if the resource is not found.

Parameters:
object - The resource to lookup.
Returns:
The name of a resource within the resource dictionary.

createShadingResource

public COSName createShadingResource(PDShading shading)
Return the name of a shading resource within the resource dictionary.

A new entry is created if the resource is not found.

Parameters:
shading - The shading to lookup.
Returns:
The name of the resource within the resource dictionary.

createXObjectResource

public COSName createXObjectResource(PDXObject xobject)
Return the name of a XObject resource within the resource dictionary.

A new entry is created if the resource is not found.

Parameters:
xobject - The object to lookup.
Returns:
the name of a XObject resource within the resource dictionary.

getColorSpaceResource

public PDColorSpace getColorSpaceResource(COSName name)
A named ColorSpace resource from the resource dictionary.

Parameters:
name - The name of the ColorSpace resource.
Returns:
A named ColorSpace resource from the resource dictionary.

getExtGStateResource

public PDExtGState getExtGStateResource(COSName name)
Return a named ExtGState resource from the resource dictionary.

Parameters:
name - The name of the ExtGState resource.
Returns:
a named ExtGState resource from the resource dictionary.

getFontResource

public PDFont getFontResource(COSName name)
Return a named font resource.

Parameters:
name - The name of the font resource
Returns:
A named font resource from within the resource dictionary.

getPatternResource

public PDPattern getPatternResource(COSName name)
Return a named Pattern resource from the resource dictionary.

Parameters:
name - The name of the Pattern resource.
Returns:
a named Pattern resource from the resource dictionary.

getResource

public PDObject getResource(COSName resourceType,
                            PDObject.MetaClass metaClass,
                            COSName name)
Return a named resource from the resource dictionary.

Parameters:
name - The name of the resource.
Returns:
a named resource from the resource dictionary.

getShadingResource

public PDShading getShadingResource(COSName name)
Return a named Pattern resource from the resource dictionary.

Parameters:
name - The name of the Pattern resource.
Returns:
a named Pattern resource from the resource dictionary.

getXObjectResource

public PDXObject getXObjectResource(COSName name)
Return a named XObject resource from the resource dictionary.

Parameters:
name - The name of the XObject resource.
Returns:
a named XObject resource from the resource dictionary.

invalidateCaches

public void invalidateCaches()
Description copied from class: COSBasedObject
Invalidate all local caches as the base object may have changed.

Overrides:
invalidateCaches in class COSBasedObject

intarsys PDF library API

Copyright © 2006 intarsys consulting GmbH. All Rights Reserved.