PdfString class
Namespace: PdfNetStack.Objects
Assembly: PdfNetStack.dll
Package: PdfNetStack
A PDF string: a sequence of bytes, which may hold text or binary data.
public sealed class PdfString : PdfObjectInheritance
object ← PdfObject ← PdfString
Constructors
Section titled “Constructors”PdfString(ReadOnlySpan<byte>)
Section titled “ PdfString(ReadOnlySpan<byte>)”Creates a string holding a copy of bytes.
public PdfString(ReadOnlySpan<byte> bytes)Parameters
Section titled “Parameters”bytes ReadOnlySpan<byte>
Properties
Section titled “Properties”The raw bytes.
public ReadOnlySpan<byte> Bytes { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”FromText(string)
Section titled “ FromText(string)”Creates a text string (ISO 32000-1, 7.9.2.2): PDFDocEncoding when every character fits, otherwise UTF-16 with a byte order mark.
public static PdfString FromText(string text)Parameters
Section titled “Parameters”text string
Returns
Section titled “Returns”ToString()
Section titled “ ToString()”Returns a string that represents the current object.
public override string ToString()Returns
Section titled “Returns”A string that represents the current object.
ToText()
Section titled “ ToText()”Decodes the bytes as a text string: UTF-16 or UTF-8 with a byte order mark, otherwise PDFDocEncoding.
public string ToText()