Class: EideticPDF::PdfObjects::PdfStream
- Inherits:
-
PdfDictionaryObject
- Object
- IndirectObject
- PdfDictionaryObject
- EideticPDF::PdfObjects::PdfStream
- Defined in:
- lib/epdfo.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Attributes inherited from IndirectObject
Instance Method Summary collapse
- #body ⇒ Object
- #filter=(filter) ⇒ Object
-
#initialize(seq, gen, stream = nil) ⇒ PdfStream
constructor
A new instance of PdfStream.
- #length ⇒ Object
Methods inherited from PdfDictionaryObject
Methods inherited from IndirectObject
#footer, #header, #reference_object, #reference_string, #to_s
Constructor Details
#initialize(seq, gen, stream = nil) ⇒ PdfStream
Returns a new instance of PdfStream.
324 325 326 327 328 |
# File 'lib/epdfo.rb', line 324 def initialize(seq, gen, stream=nil) super(seq, gen) @stream = (stream || '').dup dictionary['Length'] = PdfInteger.new(length) end |
Instance Attribute Details
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
322 323 324 |
# File 'lib/epdfo.rb', line 322 def stream @stream end |
Instance Method Details
#body ⇒ Object
342 343 344 345 |
# File 'lib/epdfo.rb', line 342 def body dictionary['Length'] = PdfInteger.new(length) "#{super}stream\n#{stream}endstream\n" end |
#filter=(filter) ⇒ Object
334 335 336 337 338 339 340 |
# File 'lib/epdfo.rb', line 334 def filter=(filter) if filter.is_a?(PdfArray) dictionary['Filter'] = filter else dictionary['Filter'] = PdfName.new(filter) end end |
#length ⇒ Object
330 331 332 |
# File 'lib/epdfo.rb', line 330 def length stream.length end |