Package 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
Class representing a /Resources object.
/Resources object contain a list of references to the fonts, patterns,
shadings, etc., for the document.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map<org.apache.fop.pdf.PDFResources.LazyName,
PDFColorSpace> Map of color spaces (key: color space name)protected Set<PDFResourceContext>
protected Map<String,
PDFDictionary> /Font objects keyed by their internal nameprotected Map<String,
PDFICCBasedColorSpace> Map of ICC color spaces (key: ICC profile description)protected Map<String,
PDFReference> Named propertiesprotected Set<PDFXObject>
Set of XObjectsFields inherited from class org.apache.fop.pdf.PDFDictionary
entries, order
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addColorSpace
(PDFColorSpace colorSpace) Add a ColorSpace dictionary to the resources.void
void
addFont
(String name, PDFDictionary font) void
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
addProperty
(String name, PDFReference property) Add a named property.void
addXObject
(PDFXObject xObject) Add an XObject to the resources.void
void
getChildren
(Set<PDFObject> children) getColorSpace
(PDFName name) Returns a color space by name.Returns a ICCBased color space by profile name.getProperty
(String name) Get a named property.int
output
(OutputStream stream) Write the PDF represention of this objectvoid
Methods inherited from class org.apache.fop.pdf.PDFDictionary
containsKey, get, getChildren, keySet, put, put, remove, 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, setObjectNumber, setObjectNumber, setParent, toPDF, toPDFString
-
Field Details
-
fonts
/Font objects keyed by their internal name -
xObjects
Set of XObjects -
colorSpaces
Map of color spaces (key: color space name) -
iccColorSpaces
Map of ICC color spaces (key: ICC profile description) -
properties
Named properties -
contexts
-
-
Constructor Details
-
PDFResources
create a /Resources object.
-
-
Method Details
-
addContext
-
setParentResources
-
getParentResources
-
addFont
add font object to resources list.- Parameters:
font
- the PDFFont to add
-
addFont
-
createFontsAsObj
public void createFontsAsObj() -
addFonts
Add the fonts in the font info to this PDF document's Font Resources.- Parameters:
doc
- PDF document to add fonts tofontInfo
- font info object to get font information from
-
addXObject
Add an XObject to the resources.- Parameters:
xObject
- the XObject to add
-
addColorSpace
Add a ColorSpace dictionary to the resources.- Parameters:
colorSpace
- the color space
-
getICCColorSpaceByProfileName
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
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
-
addProperty
Add a named property.- Parameters:
name
- name of propertyproperty
- reference to property value
-
getProperty
Get a named property.- Parameters:
name
- name of property
-
output
Description copied from class:PDFDictionary
Write the PDF represention of this object- Overrides:
output
in classPDFDictionary
- Parameters:
stream
- the stream to write the PDF to- Returns:
- the number of bytes written
- Throws:
IOException
- if there is an error writing to the stream
-
getChildren
- Overrides:
getChildren
in classPDFDictionary
-