PdfContentExtensions Class
Provides access to low level graphics state parameter dictionary entries from a PdfContentFormat type and PdfString or PdfArray objects that are used as a backing storage of PdfEncodedContentString structure.
- Inheritance:
- System.ObjectPdfContentExtensions
Methods
GetStringOrArray(PdfEncodedContentString)
Gets the PdfString or PdfArray that serves as a backing storage of the specified PdfEncodedContentString.
public static PdfBasicObject GetStringOrArray(this PdfEncodedContentString value)
<ExtensionAttribute>
Public Shared Function GetStringOrArray(value As PdfEncodedContentString) As PdfBasicObject
Parameters
The PdfEncodedContentString for which the backing PdfString or PdfArray should be retrieved.
Returns
A PdfString or PdfArray that serves as a backing storage of the specified PdfEncodedContentString.
SetValue(PdfContentFormat, PdfName, PdfBasicObject)
Sets the graphics state parameter value associated with the specified graphics state parameter key.
Supported graphics state parameter keys are listed in the first column of the Table 58 – Entries in a Graphics State Parameter Dictionary.
public static bool SetValue(this PdfContentFormat format, PdfName key, PdfBasicObject value)
<ExtensionAttribute>
Public Shared Function SetValue(format As PdfContentFormat, key As PdfName, value As PdfBasicObject) As Boolean
Parameters
format
- PdfContentFormat
The PdfContentFormat where to set the graphics state parameter.
key
- PdfName
The key of the graphics state parameter to set.
value
- PdfBasicObject
The value of the graphics state parameter to set.
Returns
- System.Boolean
true if the graphics state parameter with the specified key is supported; otherwise, false.
Remarks
If value that is being set is associated with another PdfDocument, this method will automatically clone it and associate the clone with the current PdfDocument.
Exceptions
- System.ArgumentNullException
format
or key
is null.
TryGetValue(PdfContentFormat, PdfName, out PdfBasicObject)
Gets the graphics state parameter value associated with the specified graphics state parameter key.
Supported graphics state parameter keys are listed in the first column of the Table 58 – Entries in a Graphics State Parameter Dictionary.
public static bool TryGetValue(this PdfContentFormat format, PdfName key, out PdfBasicObject value)
<ExtensionAttribute>
Public Shared Function TryGetValue(format As PdfContentFormat, key As PdfName, ByRef value As PdfBasicObject) As Boolean
Parameters
format
- PdfContentFormat
The PdfContentFormat from where to retrieve the graphics state parameter.
key
- PdfName
The key of the graphics state parameter to get.
value
- PdfBasicObject
When this method returns, contains the graphics state parameter value associated with the specified key, if the key is a valid graphics state parameter key; otherwise, the Null value.
Returns
- System.Boolean
true if the graphics state parameter with the specified key is supported; otherwise, false.
Exceptions
- System.ArgumentNullException
format
or key
is null.