GemBox.Pdf
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    PdfContentExtensions Class

    Namespace:
    GemBox.Pdf.Objects
    Assembly:
    GemBox.Pdf.dll

    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.

    • C#
    • VB.NET
    public static class PdfContentExtensions
    Public Module PdfContentExtensions
    Inheritance:
    System.Object
    PdfContentExtensions

    Methods

    GetStringOrArray(PdfEncodedContentString)

    Gets the PdfString or PdfArray that serves as a backing storage of the specified PdfEncodedContentString.

    • C#
    • VB.NET
    public static PdfBasicObject GetStringOrArray(this PdfEncodedContentString value)
    <ExtensionAttribute>
    Public Shared Function GetStringOrArray(value As PdfEncodedContentString) As PdfBasicObject
    Parameters
    value
    PdfEncodedContentString

    The PdfEncodedContentString for which the backing PdfString or PdfArray should be retrieved.

    Returns
    PdfBasicObject

    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.

    • C#
    • VB.NET
    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.

    • C#
    • VB.NET
    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.

    See Also

    PDF Specification ISO 32000-1:2008, section '8.4.5 Graphics State Parameter Dictionaries'
    PDF Specification ISO 32000-1:2008, section '9.4.3 Text-Showing Operators'
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.