Skip to content

PdfString class

View as Markdown

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 : PdfObject

Inheritance

object ← PdfObject ← PdfString

Creates a string holding a copy of bytes.

public PdfString(ReadOnlySpan<byte> bytes)

bytes ReadOnlySpan<byte>

The raw bytes.

public ReadOnlySpan<byte> Bytes { get; }

ReadOnlySpan<byte>

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)

text string

PdfString

Returns a string that represents the current object.

public override string ToString()

string

A string that represents the current object.

Decodes the bytes as a text string: UTF-16 or UTF-8 with a byte order mark, otherwise PDFDocEncoding.

public string ToText()

string