public class PDFResources extends PDFDictionary
Modifier and Type | Field and Description |
---|---|
protected Map<org.apache.fop.pdf.PDFResources.LazyName,PDFColorSpace> |
colorSpaces
Map of color spaces (key: color space name)
|
protected Set<PDFResourceContext> |
contexts |
protected Map<String,PDFDictionary> |
fonts
/Font objects keyed by their internal name
|
protected Map<String,PDFICCBasedColorSpace> |
iccColorSpaces
Map of ICC color spaces (key: ICC profile description)
|
protected Map<String,PDFReference> |
properties
Named properties
|
protected Set<PDFXObject> |
xObjects
Set of XObjects
|
entries, order
Constructor and Description |
---|
PDFResources(PDFDocument doc)
create a /Resources object.
|
Modifier and Type | Method and Description |
---|---|
void |
addColorSpace(PDFColorSpace colorSpace)
Add a ColorSpace dictionary to the resources.
|
void |
addContext(PDFResourceContext c) |
void |
addFont(PDFFont font)
add font object to resources list.
|
void |
addFont(String name,
PDFDictionary font) |
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 |
createFontsAsObj() |
void |
getChildren(Set<PDFObject> children) |
PDFColorSpace |
getColorSpace(PDFName name)
Returns a color space by name.
|
PDFICCBasedColorSpace |
getICCColorSpaceByProfileName(String desc)
Returns a ICCBased color space by profile name.
|
PDFResources |
getParentResources() |
PDFReference |
getProperty(String name)
Get a named property.
|
int |
output(OutputStream stream)
Write the PDF represention of this object
|
void |
setParentResources(PDFResources p) |
containsKey, get, getChildren, keySet, put, put, remove, writeDictionary
contentEquals, encode, encodeBinaryToHexString, encodeString, encodeText, formatObject, getDocument, getDocumentSafely, getGeneration, getObjectID, getObjectNumber, getParent, hasObjectNumber, makeReference, outputInline, referencePDF, setDocument, setObjectNumber, setObjectNumber, setObjectNumber, setParent, supportsObjectStream, toPDF, toPDFString
protected Map<String,PDFDictionary> fonts
protected Set<PDFXObject> xObjects
protected Map<org.apache.fop.pdf.PDFResources.LazyName,PDFColorSpace> colorSpaces
protected Map<String,PDFICCBasedColorSpace> iccColorSpaces
protected Map<String,PDFReference> properties
protected Set<PDFResourceContext> contexts
public PDFResources(PDFDocument doc)
public void addContext(PDFResourceContext c)
public void setParentResources(PDFResources p)
public PDFResources getParentResources()
public void addFont(PDFFont font)
font
- the PDFFont to addpublic void addFont(String name, PDFDictionary font)
public void createFontsAsObj()
public void addFonts(PDFDocument doc, FontInfo fontInfo)
doc
- PDF document to add fonts tofontInfo
- font info object to get font information frompublic void addXObject(PDFXObject xObject)
xObject
- the XObject to addpublic void addColorSpace(PDFColorSpace colorSpace)
colorSpace
- the color spacepublic PDFICCBasedColorSpace getICCColorSpaceByProfileName(String desc)
desc
- the name of the color spacepublic PDFColorSpace getColorSpace(PDFName name)
name
- the name of the color spacepublic void addProperty(String name, PDFReference property)
name
- name of propertyproperty
- reference to property valuepublic PDFReference getProperty(String name)
name
- name of propertypublic int output(OutputStream stream) throws IOException
PDFDictionary
output
in class PDFDictionary
stream
- the stream to write the PDF toIOException
- if there is an error writing to the streampublic void getChildren(Set<PDFObject> children)
getChildren
in class PDFDictionary
Copyright © 2025 Apache Software Foundation. All rights reserved.