Class: RPDF::PDFStream
Overview
Stream Object TODO: stream dictionary
- PDFRef15 p36
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#dict ⇒ Object
readonly
Returns the value of attribute dict.
Attributes inherited from PDFObject
#generation_number, #object_number
Instance Method Summary collapse
-
#initialize(data, document = nil) ⇒ PDFStream
constructor
A new instance of PDFStream.
- #invalidate ⇒ Object
- #to_s ⇒ Object
Methods inherited from PDFObject
#indirect?, #invalidated?, #to_pdf, #to_ref
Constructor Details
#initialize(data, document = nil) ⇒ PDFStream
Returns a new instance of PDFStream.
12 13 14 15 16 |
# File 'lib/rpdf/pdfstream.rb', line 12 def initialize(data, document=nil) @data = data @dict = PDFDictionary.new({ :Length => data.size }) super(document) end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
10 11 12 |
# File 'lib/rpdf/pdfstream.rb', line 10 def data @data end |
#dict ⇒ Object (readonly)
Returns the value of attribute dict.
10 11 12 |
# File 'lib/rpdf/pdfstream.rb', line 10 def dict @dict end |
Instance Method Details
#invalidate ⇒ Object
18 19 20 21 |
# File 'lib/rpdf/pdfstream.rb', line 18 def invalidate super @data = nil end |
#to_s ⇒ Object
23 24 25 26 27 28 |
# File 'lib/rpdf/pdfstream.rb', line 23 def to_s bytes = @dict.to_pdf bytes << "stream\n" bytes << data bytes << "\nendstream" end |