Class: PDF::Reader::PageTextReceiver

### Home Classes Methods

### In Files

- lib/pdf/reader/page_text_receiver.rb

### Parent

Object

### Methods

- #invoke_xobject
- #move_to_next_line_and_show_text
- #page=
- #set_spacing_next_line_show_text
- #show_text
- #show_text_with_positioning

### 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::PageTextReceiver

Builds a UTF-8 string of all the text on a single page by processing all the operaters in a content stream.

### Constants

SPACE

### Attributes

content[R]
options[R]
state[R]

### Public Instance Methods

invoke_xobject(label) click to toggle source

XObjects

    # File lib/pdf/reader/page_text_receiver.rb, line 83
    def invoke_xobject(label)
      @state.invoke_xobject(label) do |xobj|
        case xobj
        when PDF::Reader::FormXObject then
          xobj.walk(self)
        end
      end
    end

move_to_next_line_and_show_text(str) click to toggle source

    # File lib/pdf/reader/page_text_receiver.rb, line 69
    def move_to_next_line_and_show_text(str) # '
      @state.move_to_start_of_next_line
      show_text(str)
    end

page=(page) click to toggle source

starting a new page

    # File lib/pdf/reader/page_text_receiver.rb, line 40
    def page=(page)
      @state = PageState.new(page)
      @content = []
      @characters = []
      @mediabox = page.attributes[:MediaBox]
    end

set_spacing_next_line_show_text(aw, ac, string) click to toggle source

    # File lib/pdf/reader/page_text_receiver.rb, line 74
    def set_spacing_next_line_show_text(aw, ac, string) # "
      @state.set_word_spacing(aw)
      @state.set_character_spacing(ac)
      move_to_next_line_and_show_text(string)
    end

show_text(string) click to toggle source

Text Showing Operators

record text that is drawn on the page

    # File lib/pdf/reader/page_text_receiver.rb, line 55
    def show_text(string) # Tj (AWAY)
      internal_show_text(string)
    end

show_text_with_positioning(params) click to toggle source

    # File lib/pdf/reader/page_text_receiver.rb, line 59
    def show_text_with_positioning(params) # TJ [(A) 120 (WA) 20 (Y)]
      params.each do |arg|
        if arg.is_a?(String)
          internal_show_text(arg)
        else
          @state.process_glyph_displacement(0, arg, false)
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.