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

    Show / Hide Table of Contents

    PdfContentString Struct

    Namespace:
    GemBox.Pdf.Content
    Assembly:
    GemBox.Pdf.dll

    Represents PdfTextContent as a sequence of glyphs (PdfContentChars).

    • C#
    • VB.NET
    public struct PdfContentString : IEnumerable<PdfContentChar>, IEnumerable
    Public Structure PdfContentString
        Implements IEnumerable(Of PdfContentChar), IEnumerable
    Implements
    System.Collections.Generic.IEnumerable<PdfContentChar>
    System.Collections.IEnumerable
    Remarks

    A PdfContentString retrieved from the Text property is valid as long as the information on which it depends is not modified on the PdfTextContent element. The information on which it depends is: EncodedText, TextTransform and Text-related Format members GetFont(out Double), HorizontalScaling, Rise, CharacterSpacing and WordSpacing.

    This type is a higher-level counterpart of the PdfEncodedContentString.

    Properties

    Glyphs[Int32]

    Gets the glyph (PdfContentChar) at a specified position in the PdfContentString.

    • C#
    • VB.NET
    public readonly PdfContentChar this[int index] { get; }
    Public ReadOnly Property Glyphs(index As Integer) As PdfContentChar
    Parameters
    index
    System.Int32

    A position in the PdfContentString.

    Property Value
    PdfContentChar

    The glyph (PdfContentChar) at position index.

    Exceptions
    System.IndexOutOfRangeException

    index is greater than or equal to the length of this PdfContentString or less than zero.

    Length

    Gets the number of glyphs (PdfContentChars) in the PdfContentString.

    • C#
    • VB.NET
    public readonly int Length { get; }
    Public ReadOnly Property Length As Integer
    Property Value
    System.Int32

    The number of glyphs (PdfContentChars) in the PdfContentString.

    Remarks

    The Length property returns the number of glyphs (PdfContentChars) in this instance, not the number of Unicode characters. The reason is that a single glyph (PdfContentChar) might represent more than one Unicode character. Use the ToString() to work with Unicode characters.

    Methods

    GetEnumerator()

    Retrieves an enumerator that can iterate through the individual glyphs (PdfContentChars) in this PdfContentString.

    • C#
    • VB.NET
    public PdfContentString.Enumerator GetEnumerator()
    Public Function GetEnumerator As PdfContentString.Enumerator
    Returns
    PdfContentString.Enumerator

    An enumerator.

    ToString()

    Returns a Unicode text contained in this PdfContentString.

    • C#
    • VB.NET
    public override string ToString()
    Public Overrides Function ToString As String
    Returns
    System.String

    A Unicode text contained in this PdfContentString.

    Overrides
    System.ValueType.ToString()

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.