Class Origami::PDF::Header
In: sources/parser/header.rb
Parent: Object

Class representing a PDF Header.

Methods

new   to_s  

Constants

MINVERSION = 0
MAXVERSION = 7

Attributes

majorversion  [RW] 
minorversion  [RW] 

Public Class methods

Creates a file header, with the given major and minor versions.

majorversion:Major PDF version, must be 1.
minorversion:Minor PDF version, must be between 0 and 7.

[Source]

    # File sources/parser/header.rb, line 48
48:       def initialize(majorversion = 1, minorversion = 4)
49:       
50:         if majorversion.to_i != 1 || ! ((MINVERSION..MAXVERSION) === minorversion.to_i)
51:           raise InvalidHeader, "Invalid file version : #{majorversion}.#{minorversion}" 
52:         end
53:       
54:         @majorversion, @minorversion = majorversion, minorversion
55:       end

Public Instance methods

Outputs self into PDF code.

[Source]

    # File sources/parser/header.rb, line 74
74:       def to_s
75:         "%PDF-#{@majorversion}.#{@minorversion}" + EOL
76:       end

[Validate]