[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.PdfEnum-1

PdfEnum<TEnum> Struct

Represents a PDF enumeration type.

Implements
Namespace: GrapeCity.Documents.Pdf
Assembly: DS.Documents.Pdf.dll
Syntax
public struct PdfEnum<TEnum> : IEquatable<PdfEnum<TEnum>> where TEnum : struct
Public Structure PdfEnum(Of TEnum As Structure)
    Implements IEquatable(Of PdfEnum(Of TEnum))
Type Parameters
Name Description
TEnum
Remarks

The PDF Specification defines many properties with values represented by a limited set of predefined values. Such values are stored as PDF name objects, which is very similar to enumerations in C#.

But there are many PDF documents in which some of such properties have arbitrary custom values that are not defined in the PDF specification.

GcPdf uses this struct when processing such values. Where possible, the value is converted to the underlying enumeration type TEnum, otherwise the original string value is preserved.

Constructors

Name Description
PdfEnum(PdfName)

Initializes a new instance of the PdfEnum<TEnum> struct using a PdfName object. The passed PdfName is converted to TEnum if possible.

PdfEnum(string)

Initializes a new instance of the PdfEnum<TEnum> struct using a string. The passed string is converted to TEnum if possible.

PdfEnum(TEnum)

Initializes a new instance of the PdfEnum<TEnum> struct using a TEnum value.

Properties

Name Description
EnumValue

Gets the TEnum value defined by this PdfEnum<TEnum>. Throws an exception if this PdfEnum<TEnum> is represented by an unparsed PDF value.

IsPdfValue

Gets a value indicating whether this PdfEnum<TEnum> struct contains a PDF value which cannot be converted to PdfEnum<TEnum>.

IsString

Gets a value indicating whether this PdfEnum<TEnum> struct contains a string value which cannot be converted to PdfEnum<TEnum>.

PdfValue

Gets the PDF value defined by this PdfEnum<TEnum>. Throws an exception if this PdfEnum<TEnum> is represented by a parsed TEnum value.

Methods

Name Description
Equals(PdfEnum<TEnum>)

Checks whether this PdfEnum<TEnum> is equal to another PdfEnum<TEnum>.

Equals(PdfEnum<TEnum>?, TEnum?)

Returns true if nullable PdfEnum<TEnum> equals to nullable TEnum value.

Equals(object)
Equals(TEnum)

Checks whether this PdfEnum<TEnum> is equal to TEnum value.

GetEnumValue(TEnum)

Returns the EnumValue if IsString is false, defValue otherwise.

GetHashCode()
ToString()

Operators