PdfTextContent Class
Represents a textual PDF content (a sequence of glyphs from a single face of a single font).
public sealed class PdfTextContent : PdfVisualContentElement
Public NotInheritable Class PdfTextContent
Inherits PdfVisualContentElement
- Inheritance:
- System.ObjectPdfTextContent
Properties
Bounds
Gets the bounds of the PdfTextContent.
Property Value
The bounds of the PdfTextContent.
Overrides
Remarks
This member, although exposed as a property for easier debugging, performs complex calculations, so instead of accessing it frequently, cache its result instead.
ElementType
Gets the Text value.
public override PdfContentElementType ElementType { get; }
Public Overrides ReadOnly Property ElementType As PdfContentElementType
Property Value
The Text value.
Overrides
EncodedText
Gets or sets the sequence of character codes, with optionally individually positioned glyphs, that represent a PdfBasicFont-encoded text contained in this PdfTextContent element.
warning
When setting a PdfEncodedContentString value, note that the current font (retrieved with PdfTextContent.Format.Text.GetFont(out Double) method) might not contain all the necessary information to correctly position, render and/or convert to Unicode all characters of the new PdfEncodedContentString value so set it at your own risk.
public PdfEncodedContentString EncodedText { get; set; }
Public Property EncodedText As PdfEncodedContentString
Property Value
The sequence of character codes, with optionally individually positioned glyphs, that represent a PdfBasicFont-encoded text contained in this PdfTextContent element.
Exceptions
- System.ArgumentException
Value is empty.
Location
Gets the baseline origin location of the PdfTextContent.
Property Value
The baseline origin location of the PdfTextContent.
Remarks
This property is a shorthand for offset of the TextRenderingTransform matrix.
TextRenderingTransform
Gets the transformation from text space to device space of the parent PdfContentGroup.
To get the transformation from text space to device space of the page, append Transform matrices of all ancestor PdfContentGroups to TextRenderingTransform matrix.
public PdfMatrix TextRenderingTransform { get; }
Public ReadOnly Property TextRenderingTransform As PdfMatrix
Property Value
The transformation from text space to device space of the parent PdfContentGroup.
Remarks
TextRenderingTransform is a temporary matrix; conceptually, it is recomputed before each glyph is painted during a text-showing operation.
TextTransform
Gets or sets the transformation from text space to user space.
Text space is the coordinate system in which text is shown. Specifically, the origin of the first glyph shown by a text-showing operator is placed at the origin of text space. If text space has been translated, scaled, or rotated, then the position, size, or orientation of the glyph in user space is correspondingly altered.
Property Value
The transformation from text space to user space.
See Also
Methods
GetGlyphOffsets()
Gets the offset of each glyph contained in this PdfTextContent from the starting point.
public IEnumerable<double> GetGlyphOffsets()
Public Function GetGlyphOffsets As IEnumerable(Of Double)
Returns
- System.Collections.Generic.IEnumerable<System.Double>
Returns an System.Collections.Generic.IEnumerable<T> of type System.Double which has elements of glyph offsets.
Split()
Splits the current PdfTextContent if it is shown in the underlying content stream using the TJ operator and if any position adjustment in the TJ array is such that it introduces a considerable spacing between the surrounding characters.
Returns
- System.Int32
The number of PdfTextContents into which the current PdfTextContent is split. If zero is returned, then the current PdfTextContent is not split.
ToString()
Returns a Unicode text contained in this PdfTextContent.
Returns
- System.String
A Unicode text contained in this PdfTextContent.
Overrides
Inherited Properties
Collection | Gets the PdfContentElementCollection that the PdfContentElement belongs to. (Inherited from PdfContentElement) |
Format | Gets or sets the formatting properties applied to the PdfVisualContentElement. (Inherited from PdfVisualContentElement) |
Next | Gets the next PdfContentElement in the Collection. (Inherited from PdfContentElement) |
Previous | Gets the previous PdfContentElement in the Collection. (Inherited from PdfContentElement) |
Transform | Gets or sets the transformation from the new (transformed) coordinate system to the original (untransformed) coordinate system. All coordinates used after the transformation are expressed in the transformed coordinate system. tipBefore setting the Transform, move PdfVisualContentElement into its own PdfContentGroup so that the transformation is confined to that PdfContentGroup and doesn't have any effect on PdfContentElements outside that PdfContentGroup. (Inherited from PdfVisualContentElement) |