public class PdfResources extends PdfObjectWrapper<PdfDictionary>
Constructor and Description |
---|
PdfResources()
Creates new instance from empty dictionary.
|
PdfResources(PdfDictionary pdfObject)
Creates new instance from given dictionary.
|
Modifier and Type | Method and Description |
---|---|
PdfName |
addColorSpace(PdfColorSpace cs)
Adds PdfColorSpace object to the resources.
|
PdfName |
addColorSpace(PdfObject colorSpace)
Adds PdfObject to the resources as color space.
|
PdfName |
addExtGState(PdfDictionary extGState)
Adds PdfDictionary to the resources as graphics state parameter dictionary.
|
PdfName |
addExtGState(PdfExtGState extGState)
Adds PdfExtGState object to the resources.
|
PdfName |
addFont(PdfDocument pdfDocument, PdfFont font)
Adds font to resources and registers PdfFont in the document for further flushing.
|
PdfName |
addForm(PdfFormXObject form)
Adds PdfFormXObject object to the resources.
|
PdfName |
addForm(PdfFormXObject form, PdfName name)
Adds the given Form XObject to the current instance of PdfResources .
|
PdfName |
addForm(PdfStream form)
Adds PdfStream to the resources as form.
|
PdfName |
addImage(PdfImageXObject image)
Adds PdfImageXObject object to the resources.
|
PdfName |
addImage(PdfStream image)
Adds PdfStream to the resources as image.
|
PdfName |
addPattern(PdfDictionary pattern)
Adds PdfDictionary to the resources as pattern.
|
PdfName |
addPattern(PdfPattern pattern)
Adds PdfPattern object to the resources.
|
PdfName |
addProperties(PdfDictionary properties)
Adds PdfDictionary to the resources as properties list.
|
protected void |
addResource(PdfObject resource, PdfName resType, PdfName resName) |
PdfName |
addShading(PdfDictionary shading)
Adds PdfDictionary to the resources as shading dictionary.
|
PdfName |
addShading(PdfShading shading)
Adds PdfShading object to the resources.
|
protected void |
buildResources(PdfDictionary dictionary) |
PdfColorSpace |
getColorSpace(PdfName name) |
PdfFormXObject |
getForm(PdfName name) |
PdfImageXObject |
getImage(PdfName name) |
PdfPattern |
getPattern(PdfName name) |
PdfExtGState |
getPdfExtGState(PdfName name) |
PdfArray |
getProcSet()
Gets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2).
|
PdfObject |
getProperties(PdfName name) |
PdfDictionary |
getResource(PdfName resType)
Get the PdfDictionary object that that contain resources of specified type.
|
PdfName |
getResourceName(PdfObject resource)
Gets the mapped resource name of the given PdfObject .
|
|
getResourceName(PdfObjectWrapper
Gets the mapped resource name of the PdfObject under the given wrapper.
|
Set<PdfName> |
getResourceNames()
Gets the names of all the added resources.
|
Set<PdfName> |
getResourceNames(PdfName resType)
Gets the names of all resources of specified type.
|
PdfObject |
getResourceObject(PdfName resType, PdfName resName)
Get the PdfObject object with specified type and name.
|
PdfShading |
getShading(PdfName name) |
protected boolean |
isModified() |
protected boolean |
isReadOnly() |
protected boolean |
isWrappedObjectMustBeIndirect()
Defines if the object behind this wrapper must be an indirect object in the resultant document.
|
void |
setDefaultCmyk(PdfColorSpace defaultCs)
Sets the value of default CMYK Color Space (see ISO-320001 Paragraph 8.6.5.6).
|
void |
setDefaultGray(PdfColorSpace defaultCs)
Sets the value of default Gray Color Space (see ISO-320001 Paragraph 8.6.5.6).
|
void |
setDefaultRgb(PdfColorSpace defaultCs)
Sets the value of default RGB Color Space (see ISO-320001 Paragraph 8.6.5.6).
|
PdfObjectWrapper<PdfDictionary> |
setModified() |
protected void |
setModified(boolean isModified)
Deprecated.
Please use
setModified() .
|
void |
setProcSet(PdfArray array)
Sets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2).
|
protected void |
setReadOnly(boolean readOnly) |
ensureObjectIsAddedToDocument, ensureUnderlyingObjectHasIndirectReference, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setPdfObject, unsetForbidRelease
public PdfResources(PdfDictionary pdfObject)
pdfObject
- the PdfDictionary
object from which the resource object will be created.
public PdfResources()
public PdfName addFont(PdfDocument pdfDocument, PdfFont font)
pdfDocument
- a PdfDocument
instance to which the font is added for further flushing
font
- a PdfFont
instance to be added
public PdfName addImage(PdfImageXObject image)
PdfImageXObject
object to the resources.
image
- the PdfImageXObject
to add.
public PdfName addImage(PdfStream image)
PdfStream
to the resources as image.
image
- the PdfStream
to add.
public PdfImageXObject getImage(PdfName name)
public PdfName addForm(PdfFormXObject form)
PdfFormXObject
object to the resources.
form
- the PdfFormXObject
to add.
public PdfName addForm(PdfStream form)
PdfStream
to the resources as form.
form
- the PdfStream
to add.
public PdfName addForm(PdfFormXObject form, PdfName name)
PdfResources
.
form
- Form XObject.
name
- Preferred name for the given Form XObject.
PdfName
of the newly added resource
public PdfFormXObject getForm(PdfName name)
public PdfName addExtGState(PdfExtGState extGState)
PdfExtGState
object to the resources.
extGState
- the PdfExtGState
to add.
public PdfName addExtGState(PdfDictionary extGState)
PdfDictionary
to the resources as graphics state parameter dictionary.
extGState
- the PdfDictionary
to add.
public PdfExtGState getPdfExtGState(PdfName name)
public PdfName addProperties(PdfDictionary properties)
PdfDictionary
to the resources as properties list.
properties
- the PdfDictionary
to add.
public PdfName addColorSpace(PdfColorSpace cs)
PdfColorSpace
object to the resources.
cs
- the PdfColorSpace
to add.
public PdfName addColorSpace(PdfObject colorSpace)
PdfObject
to the resources as color space.
colorSpace
- the PdfObject
to add.
public PdfColorSpace getColorSpace(PdfName name)
public PdfName addPattern(PdfPattern pattern)
PdfPattern
object to the resources.
pattern
- the PdfPattern
to add.
public PdfName addPattern(PdfDictionary pattern)
PdfDictionary
to the resources as pattern.
pattern
- the PdfDictionary
to add.
public PdfPattern getPattern(PdfName name)
public PdfName addShading(PdfShading shading)
PdfShading
object to the resources.
shading
- the PdfShading
to add.
public PdfName addShading(PdfDictionary shading)
PdfDictionary
to the resources as shading dictionary.
shading
- the PdfDictionary
to add.
public PdfShading getShading(PdfName name)
protected boolean isReadOnly()
protected void setReadOnly(boolean readOnly)
protected boolean isModified()
@Deprecated protected void setModified(boolean isModified)
setModified()
.
PdfResources
indirect object. The flag denotes that the object was modified since the document opening.
isModified
- true
if this PdfResources
indirect object has been modified, otherwise false
.
PdfObject.setModified()
public PdfObjectWrapper<PdfDictionary> setModified()
setModified
in class PdfObjectWrapper<PdfDictionary>
public void setDefaultGray(PdfColorSpace defaultCs)
defaultCs
- the color space to set.
public void setDefaultRgb(PdfColorSpace defaultCs)
defaultCs
- the color space to set.
public void setDefaultCmyk(PdfColorSpace defaultCs)
defaultCs
- the color space to set.
publicPdfObject> PdfName getResourceName(PdfObjectWrapper resource)
PdfObject
under the given wrapper.
public PdfName getResourceName(PdfObject resource)
PdfObject
.
resource
- the object, for which the name will be searched.
null
if object isn't added to resources.
public Set<PdfName> getResourceNames()
public PdfArray getProcSet()
public void setProcSet(PdfArray array)
array
- the array of predefined procedure set names to be set.
public Set<PdfName> getResourceNames(PdfName resType)
resType
- the resource type. Should be PdfName.ColorSpace
, PdfName.ExtGState
, PdfName.Pattern
, PdfName.Shading
, PdfName.XObject
, PdfName.Font
.
public PdfDictionary getResource(PdfName resType)
PdfDictionary
object that that contain resources of specified type.
resType
- the resource type. Should be PdfName.ColorSpace
, PdfName.ExtGState
, PdfName.Pattern
, PdfName.Shading
, PdfName.XObject
, PdfName.Font
.
PdfDictionary
object containing all resources of specified type, or null
in case of incorrect resource type.
public PdfObject getResourceObject(PdfName resType, PdfName resName)
PdfObject
object with specified type and name.
resType
- the resource type. Should be PdfName.ColorSpace
, PdfName.ExtGState
, PdfName.Pattern
, PdfName.Shading
, PdfName.XObject
, PdfName.Font
.
resName
- the name of the resource object.
PdfObject
with specified name in the resources of specified type or null
in case of incorrect type or missing resource with such name.
protected boolean isWrappedObjectMustBeIndirect()
PdfObjectWrapper
isWrappedObjectMustBeIndirect
in class PdfObjectWrapper<PdfDictionary>
protected void buildResources(PdfDictionary dictionary)
Copyright © 1998–2023 iText Group NV. All rights reserved.