Class: PDF::Reader::Stream

### Home Classes Methods

### In Files

- lib/pdf/reader/stream.rb

### Parent

Object

### Methods

- ::new
- #unfiltered_data

### Files

- MIT-LICENSE
- README.rdoc
- TODO
- mac_expert.txt
- mac_roman.txt
- pdf_doc.txt
- standard.txt
- symbol.txt
- win_ansi.txt
- zapf_dingbats.txt
- glyphlist.txt

### Class/Module Index

Quicksearch

- PDF
- PDF::Reader
- PDF::Reader::Buffer
- PDF::Reader::CidWidths
- PDF::Reader::EncryptedPDFError
- PDF::Reader::Filter
- PDF::Reader::Filter::Ascii85
- PDF::Reader::Filter::AsciiHex
- PDF::Reader::Filter::Depredict
- PDF::Reader::Filter::Flate
- PDF::Reader::Filter::Lzw
- PDF::Reader::Filter::Null
- PDF::Reader::Filter::RunLength
- PDF::Reader::Font
- PDF::Reader::FontDescriptor
- PDF::Reader::FormXObject
- PDF::Reader::InvalidObjectError
- PDF::Reader::MalformedPDFError
- PDF::Reader::ObjectCache
- PDF::Reader::ObjectHash
- PDF::Reader::PageLayout
- PDF::Reader::PageState
- PDF::Reader::PageTextReceiver
- PDF::Reader::Parser
- PDF::Reader::PrintReceiver
- PDF::Reader::Reference
- PDF::Reader::RegisterReceiver
- PDF::Reader::ResourceMethods
- PDF::Reader::StandardSecurityHandler
- PDF::Reader::Stream
- PDF::Reader::SynchronizedCache
- PDF::Reader::TextReceiver
- PDF::Reader::TextRun
- PDF::Reader::TransformationMatrix
- PDF::Reader::UnsupportedFeatureError
- PDF::Reader::WidthCalculator
- PDF::Reader::WidthCalculator::BuiltIn
- PDF::Reader::WidthCalculator::Composite
- PDF::Reader::WidthCalculator::TrueType
- PDF::Reader::WidthCalculator::TypeOneOrThree
- PDF::Reader::WidthCalculator::TypeZero
- PDF::Reader::XRef
- AFM
- AFM::Font

No matching classes.

# PDF::Reader::Stream

An internal PDF::Reader class that represents a stream object from a PDF. Stream objects have 2 components, a dictionary that describes the content (size, compression, etc) and a stream of bytes.

### Attributes

data[RW]
hash[RW]

### Public Class Methods

new(hash, data) click to toggle source

Creates a new stream with the specified dictionary and data. The dictionary should be a standard ruby hash, the data should be a standard ruby string.

    # File lib/pdf/reader/stream.rb, line 39
    def initialize (hash, data)
      @hash = hash
      @data = data
      @udata = nil
    end

### Public Instance Methods

unfiltered_data() click to toggle source

apply this streams filters to its data and return the result.

    # File lib/pdf/reader/stream.rb, line 46
    def unfiltered_data
      return @udata if @udata
      @udata = data.dup

      if hash.has_key?(:Filter)
        options = []

        if hash.has_key?(:DecodeParms)
          if hash[:DecodeParms].is_a?(Hash)
            options = [hash[:DecodeParms]]
          else
            options = hash[:DecodeParms]
          end
        end

        Array(hash[:Filter]).each_with_index do |filter, index|
          @udata = Filter.with(filter, options[index]).filter(@udata)
        end
      end
      @udata
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.