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 |
addExtGState(PdfObject extGState)
Deprecated.
Will be removed in iText 7.1. Use more safe
addExtGState(PdfDictionary) instead.
|
PdfName |
addFont(PdfDocument pdfDocument, PdfFont font)
Adds font to resources and register 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(PdfObject form)
Deprecated.
Will be removed in iText 7.1. Use more safe
addForm(PdfStream) instead.
|
PdfName |
addForm(PdfStream form)
Adds PdfStream to the resources as form.
|
PdfName |
addImage(PdfImageXObject image)
Adds PdfImageXObject object to the resources.
|
PdfName |
addImage(PdfObject image)
Deprecated.
Will be removed in iText 7.1. Use more safe
addImage(PdfStream) instead.
|
PdfName |
addImage(PdfStream image)
Adds PdfStream to the resources as image.
|
PdfName |
addPattern(PdfDictionary pattern)
Adds PdfDictionary to the resources as pattern.
|
PdfName |
addPattern(PdfObject pattern)
Deprecated.
Will be removed in iText 7.1. Use more safe
addPattern(PdfDictionary) instead.
|
PdfName |
addPattern(PdfPattern pattern)
Adds PdfPattern object to the resources.
|
PdfName |
addProperties(PdfDictionary properties)
Adds PdfDictionary to the resources as properties list.
|
PdfName |
addProperties(PdfObject properties)
Deprecated.
Will be removed in iText 7.1. Use more safe
addProperties(PdfDictionary) instead.
|
protected void |
addResource(PdfObject resource, PdfName resType, PdfName resName) |
PdfName |
addShading(PdfDictionary shading)
Adds PdfDictionary to the resources as shading dictionary.
|
PdfName |
addShading(PdfObject shading)
Deprecated.
Will be removed in iText 7.1. Use more safe
addShading(PdfDictionary) instead.
|
PdfName |
addShading(PdfShading shading)
Adds PdfShading object to the resources.
|
protected void |
buildResources(PdfDictionary dictionary) |
PdfArray |
getProcSet()
Gets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2).
|
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.
|
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 |
setDefaultColorSpace(PdfName defaultCsKey, PdfColorSpace defaultCsValue)
Deprecated.
Will be removed in iText 7.1.0. Use
setDefaultGray(PdfColorSpace) , setDefaultRgb(PdfColorSpace) or setDefaultCmyk(PdfColorSpace) instead.
|
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).
|
protected void |
setModified(boolean isModified) |
void |
setProcSet(PdfArray array)
Sets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2).
|
protected void |
setReadOnly(boolean readOnly) |
ensureObjectIsAddedToDocument, flush, getPdfObject, isFlushed, makeIndirect, makeIndirect, markObjectAsIndirect, setForbidRelease, setModified, 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)
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.
@Deprecated public PdfName addImage(PdfObject image)
addImage(PdfStream)
instead.
PdfObject
to the resources as image.
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.
@Deprecated public PdfName addForm(PdfObject form)
addForm(PdfStream)
instead.
PdfObject
to the resources as form.
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 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.
@Deprecated public PdfName addExtGState(PdfObject extGState)
addExtGState(PdfDictionary)
instead.
PdfObject
to the resources as graphics state parameter dictionary.
extGState
- the PdfObject
to add. Should be PdfDictionary
.
public PdfName addProperties(PdfDictionary properties)
PdfDictionary
to the resources as properties list.
properties
- the PdfDictionary
to add.
@Deprecated public PdfName addProperties(PdfObject properties)
addProperties(PdfDictionary)
instead.
PdfObject
to the resources as properties list.
properties
- the PdfObject
to add. Should be PdfDictionary
.
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 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.
@Deprecated public PdfName addPattern(PdfObject pattern)
addPattern(PdfDictionary)
instead.
PdfObject
to the resources as pattern.
pattern
- the PdfObject
to add. Should be PdfDictionary
or PdfStream
.
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.
@Deprecated public PdfName addShading(PdfObject shading)
addShading(PdfDictionary)
instead.
PdfObject
to the resources as shading dictionary.
shading
- the PdfObject
to add. Should be PdfDictionary
or PdfStream
.
protected boolean isReadOnly()
protected void setReadOnly(boolean readOnly)
protected boolean isModified()
protected void setModified(boolean isModified)
@Deprecated public void setDefaultColorSpace(PdfName defaultCsKey, PdfColorSpace defaultCsValue)
setDefaultGray(PdfColorSpace)
, setDefaultRgb(PdfColorSpace)
or setDefaultCmyk(PdfColorSpace)
instead.
defaultCsKey
- the name of Default Color Space. Should be PdfName.DefaultGray
, PdfName.DefaultRGB
, or PdfName.DefaultCMYK
.
defaultCsValue
- the value of the default color space to be set.
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.
protected boolean isWrappedObjectMustBeIndirect()
PdfObjectWrapper
isWrappedObjectMustBeIndirect
in class PdfObjectWrapper<PdfDictionary>
protected void buildResources(PdfDictionary dictionary)
Copyright © 1998–2016 iText Group NV. All rights reserved.