PDF::Objects::Number
Inherits PDF::Objects::Base < Reference < Object
Represents a PDF numeric object (integer or real).
PDF supports both integer and real (floating-point) numbers. Integers are written without a decimal point. Reals are written with a decimal point and optional sign.
int = PDF::Objects::Number.new(42)
int.to_pdf # => "42"
real = PDF::Objects::Number.new(3.14159)
real.to_pdf # => "3.14159"
negative = PDF::Objects::Number.new(-17.5)
negative.to_pdf # => "-17.5"
Note: PDF reals have limited precision. Very small or very large values may lose precision when serialized.
Constants
MAX_DECIMAL_PLACES = 6
Maximum decimal places for real numbers
Constructors
Instance methods
==(other : self)
Returns true if this reference is the same as other. Invokes same?.
hash(hasher)
See Object#hash(hasher)
value
Source