class Origami::Trailer
Attributes
dictionary[R]
pdf[RW]
startxref[RW]
Public Class Methods
new(startxref = 0, dictionary = {})
click to toggle source
Creates a new Trailer.
- startxref
-
The file offset to the XRef::Section.
- dictionary
-
A hash of attributes to set in the Trailer Dictionary.
# File lib/origami/trailer.rb, line 121 def initialize(startxref = 0, dictionary = {}) @startxref, self.dictionary = startxref, dictionary && Dictionary.new(dictionary) end
Public Instance Methods
[](key)
click to toggle source
# File lib/origami/trailer.rb, line 147 def [](key) @dictionary[key] if has_dictionary? end
[]=(key,val)
click to toggle source
# File lib/origami/trailer.rb, line 151 def []=(key,val) @dictionary[key] = val end
dictionary=(dict)
click to toggle source
# File lib/origami/trailer.rb, line 155 def dictionary=(dict) dict.parent = self if dict @dictionary = dict end
has_dictionary?()
click to toggle source
# File lib/origami/trailer.rb, line 160 def has_dictionary? not @dictionary.nil? end
to_obfuscated_str()
click to toggle source
# File lib/origami/obfuscation.rb, line 220 def to_obfuscated_str content = "" if self.has_dictionary? content << TOKENS.first << EOL << @dictionary.to_obfuscated_str << EOL end content << XREF_TOKEN << EOL << @startxref.to_s << EOL << TOKENS.last << EOL content end
to_s()
click to toggle source
Outputs self into PDF code.
# File lib/origami/trailer.rb, line 167 def to_s content = "" if self.has_dictionary? content << TOKENS.first << EOL << @dictionary.to_s << EOL end content << XREF_TOKEN << EOL << @startxref.to_s << EOL << TOKENS.last << EOL content end