[]
Represents a PDF String.
public class PdfString : IPdfString, ActionHide.ILinkedObject, ActionFieldsBase.IFieldDef, IReadOnlyList<byte>, IReadOnlyCollection<byte>, IEnumerable<byte>, IEnumerable, IEquatable<PdfString>, IComparable<PdfString>
Technically a PDF string is an array of bytes. Its interpretation depends on the context. The PDF specification describes the following possible types:
Initializes a new instance of the PdfString class.
public PdfString(byte[] value)
value
byte[]The value.
Initializes a new instance of the PdfString class.
public PdfString(byte[] value, PdfStringFlags flags)
value
byte[]The value.
flags
PdfStringFlagsThe value of Flags.
Initializes a new instance of the PdfString class.
public PdfString(byte[] value, int offset, int length)
Initializes a new instance of the PdfString class.
public PdfString(string value)
value
stringThe value.
"Adobe"
public static readonly PdfString Adobe
The empty instance of the PdfString.
public static readonly PdfString Empty
The state of the PdfString object.
public PdfStringFlags Flags
"Identity"
public static readonly PdfString Identity
"UCS"
public static readonly PdfString UCS
"open"
public static readonly PdfString open
"print"
public static readonly PdfString print
"sRGB"
public static readonly PdfString sRGB
Gets the number of elements contained in the PdfString.
public int Count { get; }
Gets or sets the byte at the specified index.
public byte this[int index] { get; }
index
intThe zero-based index of the byte to get or set.
The byte at the specified index.
Converts a list of bytes representing a PDF string to a string.
public static string BytesToString(IList<byte> bytes)
Compares the current PdfString with another PdfString and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(PdfString other)
A value that indicates the relative order of the objects being compared. The return value has these meanings:
other
in the sort order.other
.other
.Checks whether this PdfString is equal to value
.
public bool Equals(PdfString value)
value
PdfStringpublic override bool Equals(object obj)
obj
objectCreates a PdfString from the passed string.
public static PdfString FromString(string s)
s
stringThe string to create the PDF string from.
public override int GetHashCode()
Converts a string to the array of bytes representing the PDF string.
public static byte[] StringToBytes(string s)
s
stringpublic override string ToString()