Class PdfResources
Wrapper class that represent resource dictionary - that define named resources used by content streams operators.
public class PdfResources : PdfObjectWrapper<PdfDictionary>
- Inheritance
-
PdfResources
- Inherited Members
Remarks
Wrapper class that represent resource dictionary - that define named resources used by content streams operators. (ISO 32000-1, 7.8.3 Resource Dictionaries)
Constructors
PdfResources()
Creates new instance from empty dictionary.
public PdfResources()
PdfResources(PdfDictionary)
Creates new instance from given dictionary.
public PdfResources(PdfDictionary pdfObject)
Parameters
pdfObject
PdfDictionarythe PdfDictionary object from which the resource object will be created.
Methods
AddColorSpace(PdfColorSpace)
Adds PdfColorSpace object to the resources.
public virtual PdfName AddColorSpace(PdfColorSpace cs)
Parameters
cs
PdfColorSpacethe PdfColorSpace to add.
Returns
- PdfName
added color space resource name.
AddColorSpace(PdfObject)
Adds PdfObject to the resources as color space.
public virtual PdfName AddColorSpace(PdfObject colorSpace)
Parameters
Returns
- PdfName
added color space resources name.
AddExtGState(PdfExtGState)
Adds PdfExtGState object to the resources.
public virtual PdfName AddExtGState(PdfExtGState extGState)
Parameters
extGState
PdfExtGStatethe PdfExtGState to add.
Returns
- PdfName
added graphics state parameter dictionary resource name.
AddExtGState(PdfDictionary)
Adds PdfDictionary to the resources as graphics state parameter dictionary.
public virtual PdfName AddExtGState(PdfDictionary extGState)
Parameters
extGState
PdfDictionarythe PdfDictionary to add.
Returns
- PdfName
added graphics state parameter dictionary resources name.
AddFont(PdfDocument, PdfFont)
Adds font to resources and registers PdfFont in the document for further flushing.
public virtual PdfName AddFont(PdfDocument pdfDocument, PdfFont font)
Parameters
pdfDocument
PdfDocumenta PdfDocument instance to which the font is added for further flushing
font
PdfFonta PdfFont instance to be added
Returns
- PdfName
added font resource name.
AddForm(PdfStream)
Adds PdfStream to the resources as form.
public virtual PdfName AddForm(PdfStream form)
Parameters
Returns
- PdfName
added form resources name.
AddForm(PdfFormXObject)
Adds PdfFormXObject object to the resources.
public virtual PdfName AddForm(PdfFormXObject form)
Parameters
form
PdfFormXObjectthe PdfFormXObject to add.
Returns
- PdfName
added form resource name.
AddForm(PdfFormXObject, PdfName)
Adds the given Form XObject to the current instance of PdfResources.
public virtual PdfName AddForm(PdfFormXObject form, PdfName name)
Parameters
form
PdfFormXObjectForm XObject.
name
PdfNamePreferred name for the given Form XObject.
Returns
AddImage(PdfStream)
Adds PdfStream to the resources as image.
public virtual PdfName AddImage(PdfStream image)
Parameters
Returns
- PdfName
added image resources name.
AddImage(PdfImageXObject)
Adds PdfImageXObject object to the resources.
public virtual PdfName AddImage(PdfImageXObject image)
Parameters
image
PdfImageXObjectthe PdfImageXObject to add.
Returns
- PdfName
added image resource name.
AddPattern(PdfPattern)
Adds PdfPattern object to the resources.
public virtual PdfName AddPattern(PdfPattern pattern)
Parameters
pattern
PdfPatternthe PdfPattern to add.
Returns
- PdfName
added pattern resource name.
AddPattern(PdfDictionary)
Adds PdfDictionary to the resources as pattern.
public virtual PdfName AddPattern(PdfDictionary pattern)
Parameters
pattern
PdfDictionarythe PdfDictionary to add.
Returns
- PdfName
added pattern resources name.
AddProperties(PdfDictionary)
Adds PdfDictionary to the resources as properties list.
public virtual PdfName AddProperties(PdfDictionary properties)
Parameters
properties
PdfDictionarythe PdfDictionary to add.
Returns
- PdfName
added properties list resources name.
AddResource(PdfObject, PdfName, PdfName)
protected virtual void AddResource(PdfObject resource, PdfName resType, PdfName resName)
Parameters
AddShading(PdfShading)
Adds PdfShading object to the resources.
public virtual PdfName AddShading(PdfShading shading)
Parameters
shading
PdfShadingthe PdfShading to add.
Returns
- PdfName
added shading resource name.
AddShading(PdfDictionary)
Adds PdfDictionary to the resources as shading dictionary.
public virtual PdfName AddShading(PdfDictionary shading)
Parameters
shading
PdfDictionarythe PdfDictionary to add.
Returns
- PdfName
added shading dictionary resources name.
BuildResources(PdfDictionary)
protected virtual void BuildResources(PdfDictionary dictionary)
Parameters
dictionary
PdfDictionary
GetColorSpace(PdfName)
public virtual PdfColorSpace GetColorSpace(PdfName name)
Parameters
name
PdfName
Returns
GetForm(PdfName)
public virtual PdfFormXObject GetForm(PdfName name)
Parameters
name
PdfName
Returns
GetImage(PdfName)
public virtual PdfImageXObject GetImage(PdfName name)
Parameters
name
PdfName
Returns
GetPattern(PdfName)
public virtual PdfPattern GetPattern(PdfName name)
Parameters
name
PdfName
Returns
GetPdfExtGState(PdfName)
public virtual PdfExtGState GetPdfExtGState(PdfName name)
Parameters
name
PdfName
Returns
GetProcSet()
Gets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2).
public virtual PdfArray GetProcSet()
Returns
- PdfArray
the array of predefined procedure set names.
Remarks
Gets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2). Deprecated in PDF 2.0.
GetProperties(PdfName)
public virtual PdfObject GetProperties(PdfName name)
Parameters
name
PdfName
Returns
GetResource(PdfName)
Get the PdfDictionary object that that contain resources of specified type.
public virtual PdfDictionary GetResource(PdfName resType)
Parameters
resType
PdfNamethe resource type. Should be ColorSpace , ExtGState , Pattern , Shading , XObject , Font.
Returns
- PdfDictionary
the PdfDictionary object containing all resources of specified type, or null in case of incorrect resource type.
GetResourceName(PdfObject)
Gets the mapped resource name of the given PdfObject.
public virtual PdfName GetResourceName(PdfObject resource)
Parameters
resource
PdfObjectthe object, for which the name will be searched.
Returns
Remarks
Gets the mapped resource name of the given
PdfObject.
Note: if the name for the object won't be found, then the name of object's Indirect Reference will be searched.
GetResourceName<T>(PdfObjectWrapper<T>)
Gets the mapped resource name of the PdfObject under the given wrapper.
public virtual PdfName GetResourceName<T>(PdfObjectWrapper<T> resource) where T : PdfObject
Parameters
resource
PdfObjectWrapper<T>the wrapper of the PdfObject , for which the name will be searched.
Returns
Type Parameters
T
the type of the underlined PdfObject in wrapper.
Remarks
Gets the mapped resource name of the
PdfObject
under the given wrapper.
Note: if the name for the object won't be found, then the name of object's Indirect Reference will be searched.
GetResourceNames()
Gets the names of all the added resources.
public virtual ICollection<PdfName> GetResourceNames()
Returns
- ICollection<PdfName>
the name of all the added resources.
GetResourceNames(PdfName)
Gets the names of all resources of specified type.
public virtual ICollection<PdfName> GetResourceNames(PdfName resType)
Parameters
resType
PdfNamethe resource type. Should be ColorSpace , ExtGState , Pattern , Shading , XObject , Font.
Returns
- ICollection<PdfName>
set of resources name of corresponding type. May be empty. Will be empty in case of incorrect resource type.
GetResourceObject(PdfName, PdfName)
Get the PdfObject object with specified type and name.
public virtual PdfObject GetResourceObject(PdfName resType, PdfName resName)
Parameters
resType
PdfNamethe resource type. Should be ColorSpace , ExtGState , Pattern , Shading , XObject , Font.
resName
PdfNamethe name of the resource object.
Returns
- PdfObject
the PdfObject with specified name in the resources of specified type or null in case of incorrect type or missing resource with such name.
GetShading(PdfName)
public virtual PdfShading GetShading(PdfName name)
Parameters
name
PdfName
Returns
IsModified()
protected virtual bool IsModified()
Returns
IsReadOnly()
protected virtual bool IsReadOnly()
Returns
IsWrappedObjectMustBeIndirect()
protected override bool IsWrappedObjectMustBeIndirect()
Returns
SetDefaultCmyk(PdfColorSpace)
Sets the value of default CMYK Color Space (see ISO-320001 Paragraph 8.6.5.6).
public virtual void SetDefaultCmyk(PdfColorSpace defaultCs)
Parameters
defaultCs
PdfColorSpacethe color space to set.
SetDefaultGray(PdfColorSpace)
Sets the value of default Gray Color Space (see ISO-320001 Paragraph 8.6.5.6).
public virtual void SetDefaultGray(PdfColorSpace defaultCs)
Parameters
defaultCs
PdfColorSpacethe color space to set.
SetDefaultRgb(PdfColorSpace)
Sets the value of default RGB Color Space (see ISO-320001 Paragraph 8.6.5.6).
public virtual void SetDefaultRgb(PdfColorSpace defaultCs)
Parameters
defaultCs
PdfColorSpacethe color space to set.
SetModified()
public override PdfObjectWrapper<PdfDictionary> SetModified()
Returns
SetProcSet(PdfArray)
Sets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2).
public virtual void SetProcSet(PdfArray array)
Parameters
array
PdfArraythe array of predefined procedure set names to be set.
Remarks
Sets the array of predefined procedure set names (see ISO-320001 Paragraph 14.2). Deprecated in PDF 2.0.
SetReadOnly(bool)
protected virtual void SetReadOnly(bool readOnly)
Parameters
readOnly
bool