PdfName Class
A name (ISO 32000-2, 7.3.5): an atomic symbol such as /Type. It is immutable and compared by its bytes.
public sealed class PdfName : PdfObject, IEquatable<PdfName>Remarks
A name is a sequence of bytes. PdfName.Value is that sequence decoded as UTF-8, the recommended encoding (7.3.5), or as ISO-8859-1 when it is not valid UTF-8; creating a name from a string encodes it as UTF-8.
- Inheritance
PdfObjectPdfName- Implements
Constructors
| Name | Description |
|---|---|
| PdfName(string) | Initializes a new instance of the PdfName class. |
PdfName(string)
PdfName.csInitializes a new instance of the PdfName class.
public PdfName(string value)Parameters
valuestring- The name, without the leading slash. It is encoded as UTF-8.
Exceptions
ArgumentExceptionvaluecontains the null character, which a name cannot contain (7.3.5).
Properties
| Name | Description |
|---|---|
| Kind | Gets the kind of the object. |
| Value | Gets the name, without the leading slash. |
Kind
PdfName.csValue
PdfName.csMethods
| Name | Description |
|---|---|
| Create(string) | Creates a name, or gets the shared instance of a name the library knows. |
| Equals(PdfName?) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Determines whether the specified object is equal to the current object. |
| GetHashCode() | Serves as the default hash function. |
Create(string)
PdfName.csCreates a name, or gets the shared instance of a name the library knows.
Parameters
valuestring- The name, without the leading slash.
Returns
PdfName The name.
Exceptions
ArgumentExceptionvaluecontains the null character, which a name cannot contain (7.3.5).
GetHashCode()
PdfName.csOperators
| Name | Description |
|---|---|
| operator ==(PdfName?, PdfName?) | Indicates whether two names are equal. |
| implicit operator PdfName(string) | Converts a string to a name. |
| operator !=(PdfName?, PdfName?) | Indicates whether two names are different. |