Table of Contents

Struct Name

Namespace
PdfSharp.Pdf
Assembly
PdfSharp.dll

Implements a PDF name as a value type.

public readonly struct Name

Constructors

Name()

Initializes a new instance of the Name struct with the empty name "/".

Name(string)

Initializes a new instance of the Name struct with a canonical name. The string must start with a "/".

Fields

Empty

Properties

Comparer

Gets the comparer for this type.

IsEmpty
LiteralValue

Gets the literal value of the name. That is the form which is written in a PDF file.

Value

Gets the canonical value of the name. That is the form used as keys in PdfDictionary.

Methods

Compare(Name, Name)

Compares two names.

EnsureName(string)

Ensures that the name is formally correct. It must be a non-empty string starting with a '/'.

Equals(Name)

Indicates whether the current object is equal to another object of the same type.

Equals(object?)

Indicates whether this instance and a specified object are equal.

FromCanonicalName(string)

Creates a new instance of Name from a canonical name.

FromEnum<T>(T)

Creates a Name object from an enum value.

FromLiteralName(string)

Creates a new instance of Name from a literal name.

GetHashCode()

Returns the hash code for this instance.

MakeName(string)

Converts a string into a canonical name by adding a '/' as prefix to the string. If the specified string already starts with a '/' no action is taken.

RemoveSlash(string)

Removes the slash from a string, that is needed at the beginning of a PDF name.

Operators

operator ==(Name, Name)
implicit operator string(Name)
implicit operator Name(string)
operator !=(Name, Name)