Class: RPDF::Trailer
- Inherits:
-
Object
- Object
- RPDF::Trailer
- Defined in:
- lib/rpdf/trailer.rb
Overview
File Trailer [PDFRef15 p72]
Instance Attribute Summary collapse
-
#startxref ⇒ Object
Returns the value of attribute startxref.
Instance Method Summary collapse
-
#initialize(document) ⇒ Trailer
constructor
A new instance of Trailer.
- #to_pdf ⇒ Object
Constructor Details
#initialize(document) ⇒ Trailer
Returns a new instance of Trailer.
13 14 15 |
# File 'lib/rpdf/trailer.rb', line 13 def initialize(document) @document = document end |
Instance Attribute Details
#startxref ⇒ Object
Returns the value of attribute startxref.
11 12 13 |
# File 'lib/rpdf/trailer.rb', line 11 def startxref @startxref end |
Instance Method Details
#to_pdf ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/rpdf/trailer.rb', line 17 def to_pdf dict = PDFDictionary.new({ :Size => @document.size + 1, :Root => @document.root }) bytes = "trailer\n" bytes << dict.to_pdf bytes << "\nstartxref\n" bytes << startxref.to_s << "\n" bytes << "%%EOF\n" end |