[]
        
(Showing Draft Content)

GrapeCity.Documents.Pdf.Spec.PdfNumber

Class PdfNumber

Namespace
GrapeCity.Documents.Pdf.Spec
Assembly
GcDocs.Pdf.dll

Represents a PDF Number object. This class overrides and implements:

public class PdfNumber : IPdfNumber, IEquatable<PdfNumber>
Inheritance
object
PdfNumber
Implements
System.IEquatable<T><PdfNumber>
Inherited Members
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()
Extension Methods

Constructors

PdfNumber(double, int)

Initializes a new instance of the PdfName class.

public PdfNumber(double value, int decimalPlaces)

Parameters

value double

The value.

decimalPlaces int

The count of digits after decimal point.

PdfNumber(double)

Initializes a new instance of the PdfNumber class.

public PdfNumber(double value)

Parameters

value double

The value.

PdfNumber(int)

Initializes a new instance of the PdfNumber class.

public PdfNumber(int value)

Parameters

value int

The value.

PdfNumber(uint)

Initializes a new instance of the PdfNumber class.

public PdfNumber(uint value)

Parameters

value uint

The value.

Properties

AsDouble

Converts the PdfNumber to double.

public double AsDouble { get; }

Property Value

double

AsFloat

Converts the PdfNumber to float.

public float AsFloat { get; }

Property Value

float

AsInt

Converts the PdfNumber to int. Note! The PdfNumber can contain a value does not fit into integer bounds, in this case result will be System.Int32.MinValue or System.Int32.MaxValue.

public int AsInt { get; }

Property Value

int

Methods

Create(float?)

Creates the PdfNumber object from nullable float value, returns Instance if value is null.

public static IPdfObject Create(float? value)

Parameters

value float?

The value.

Returns

GrapeCity.Documents.Pdf.Spec.IPdfObject

Equals(PdfNumber)

Indicates whether the current PdfNumber is equal to another PdfNumber.

public bool Equals(PdfNumber other)

Parameters

other PdfNumber

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

GetOrCreate(int)

Creates a new PdfNumber or returns existing predefined PdfNumber object.

public static PdfNumber GetOrCreate(int value)

Parameters

value int

Returns

PdfNumber

ToString()

public override string ToString()

Returns

string

ToString(double, int)

Converts a double value to a string. Note that a separate method ToString(float, int) exists for converting float values, separate methods are needed to avoid rounding errors that may occur when converting doubles to floats and vice versa.

The value to convert. The count of digits after decimal point.
public static string ToString(double value, int decimalPlaces)

Parameters

value double
decimalPlaces int

Returns

string

ToString(float, int)

Converts a float value to a string. Note that a separate method ToString(double, int) exists for converting double values, separate methods are needed to avoid rounding errors that may occur when converting doubles to floats and vice versa.

public static string ToString(float value, int decimalPlaces)

Parameters

value float

The value to convert.

decimalPlaces int

The count of digits after decimal point.

Returns

string

Operators

operator ==(PdfNumber, PdfNumber)

The equality operator.

public static bool operator ==(PdfNumber v1, PdfNumber v2)

Parameters

v1 PdfNumber
v2 PdfNumber

Returns

bool

explicit operator PdfNumber(double)

Converts the double to the PdfNumber.

public static explicit operator PdfNumber(double d)

Parameters

d double

The double value to convert.

Returns

PdfNumber

implicit operator double(PdfNumber)

Converts the PdfNumber to a double.

public static implicit operator double(PdfNumber pn)

Parameters

pn PdfNumber

The PdfNumber to convert.

Returns

double

operator !=(PdfNumber, PdfNumber)

The inequality operator.

public static bool operator !=(PdfNumber v1, PdfNumber v2)

Parameters

v1 PdfNumber
v2 PdfNumber

Returns

bool