Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.fop.pdf
Class PDFResources

    java.lang.Object
      org.apache.fop.pdf.PDFObject
          org.apache.fop.pdf.PDFDictionary
              org.apache.fop.pdf.PDFResources

All Implemented Interfaces:
  PDFWritable

    public class PDFResources

extends PDFDictionary

Class representing a /Resources object. /Resources object contain a list of references to the fonts for the document

Field Summary
`protected java.util.Map<PDFName,PDFColorSpace>` | `colorSpaces` Map of color spaces (key: color space name)
`protected java.util.Map<java.lang.String,PDFFont>` | `fonts` /Font objects keyed by their internal name
`protected java.util.Set<PDFGState>` | `gstates` Set of ExtGStates
`protected java.util.Map<java.lang.String,PDFICCBasedColorSpace>` | `iccColorSpaces` Map of ICC color spaces (key: ICC profile description)
`protected java.util.Set<PDFPattern>` | `patterns` Set of patterns
`protected java.util.Set<PDFShading>` | `shadings` Set of shadings
`protected java.util.Set<PDFXObject>` | `xObjects` Set of XObjects

Fields inherited from class org.apache.fop.pdf.PDFDictionary
`entries, order`

Fields inherited from class org.apache.fop.pdf.PDFObject
`log`

Constructor Summary
`PDFResources(int objnum)` create a /Resources object.

Method Summary
`void` | `addColorSpace(PDFColorSpace colorSpace)` Add a ColorSpace dictionary to the resources.
`void` | `addFont(PDFFont font)` add font object to resources list.
`void` | `addFonts(PDFDocument doc, FontInfo fontInfo)` Add the fonts in the font info to this PDF document's Font Resources.
`void` | `addGState(PDFGState gs)` Add a PDFGState to the resources.
`void` | `addPattern(PDFPattern thePattern)` Add the pattern to the resources.
`void` | `addShading(PDFShading theShading)` Add a Shading to the resources.
`void` | `addXObject(PDFXObject xObject)` Add an XObject to the resources.
`PDFColorSpace` | `getColorSpace(PDFName name)` Returns a color space by name.
`PDFICCBasedColorSpace` | `getICCColorSpaceByProfileName(java.lang.String desc)` Returns a ICCBased color space by profile name.
`int` | `output(java.io.OutputStream stream)` Write the PDF represention of this object

Methods inherited from class org.apache.fop.pdf.PDFDictionary
`get, put, put, writeDictionary`

Methods inherited from class org.apache.fop.pdf.PDFObject
`contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setParent, toPDF, toPDFString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### fonts

    protected java.util.Map<java.lang.String,PDFFont> fonts

  /Font objects keyed by their internal name

### xObjects

    protected java.util.Set<PDFXObject> xObjects

  Set of XObjects

### patterns

    protected java.util.Set<PDFPattern> patterns

  Set of patterns

### shadings

    protected java.util.Set<PDFShading> shadings

  Set of shadings

### gstates

    protected java.util.Set<PDFGState> gstates

  Set of ExtGStates

### colorSpaces

    protected java.util.Map<PDFName,PDFColorSpace> colorSpaces

  Map of color spaces (key: color space name)

### iccColorSpaces

    protected java.util.Map<java.lang.String,PDFICCBasedColorSpace> iccColorSpaces

  Map of ICC color spaces (key: ICC profile description)

Constructor Detail

### PDFResources

    public PDFResources(int objnum)

  create a /Resources object.

  Parameters:
    `objnum` - the object's number

Method Detail

### addFont

    public void addFont(PDFFont font)

  add font object to resources list.

  Parameters:
    `font` - the PDFFont to add

### addFonts

    public void addFonts(PDFDocument doc,
                         FontInfo fontInfo)

  Add the fonts in the font info to this PDF document's Font Resources.

  Parameters:
    `doc` - PDF document to add fonts to
    `fontInfo` - font info object to get font information from

### addGState

    public void addGState(PDFGState gs)

  Add a PDFGState to the resources.

  Parameters:
    `gs` - the PDFGState to add

### addShading

    public void addShading(PDFShading theShading)

  Add a Shading to the resources.

  Parameters:
    `theShading` - the shading to add

### addPattern

    public void addPattern(PDFPattern thePattern)

  Add the pattern to the resources.

  Parameters:
    `thePattern` - the pattern to add

### addXObject

    public void addXObject(PDFXObject xObject)

  Add an XObject to the resources.

  Parameters:
    `xObject` - the XObject to add

### addColorSpace

    public void addColorSpace(PDFColorSpace colorSpace)

  Add a ColorSpace dictionary to the resources.

  Parameters:
    `colorSpace` - the color space

### getICCColorSpaceByProfileName

    public PDFICCBasedColorSpace getICCColorSpaceByProfileName(java.lang.String desc)

  Returns a ICCBased color space by profile name.

  Parameters:
    `desc` - the name of the color space
  Returns:
    the requested color space or null if it wasn't found

### getColorSpace

    public PDFColorSpace getColorSpace(PDFName name)

  Returns a color space by name.

  Parameters:
    `name` - the name of the color space
  Returns:
    the requested color space or null if it wasn't found

### output

    public int output(java.io.OutputStream stream)
               throws java.io.IOException

  Description copied from class: `PDFDictionary`
  Write the PDF represention of this object

  Overrides:
    `output` in class `PDFDictionary`
  Parameters:
    `stream` - the stream to write the PDF to
  Returns:
    the number of bytes written
  Throws:
    `java.io.IOException` - if there is an error writing to the stream

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| fop 1.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.