Class: PDF::Reader::TextReceiver

Class | PDF::Reader::TextReceiver
In: | lib/pdf/reader/text_receiver.rb
Parent: | Object

An example receiver class that processes all text found in a PDF file. All text that is found will be printed to the IO object specified in the constructor.

Usage:

     receiver = PDF::Reader::TextReceiver.new($stdout)
     PDF::Reader.file("somefile.pdf", receiver)

### Methods

begin_document begin_page begin_page_container begin_text_object calculate_line_and_location end_document end_page end_page_container end_text_object media_box_check move_text_position move_text_position_and_set_leading move_to_next_line_and_show_text move_to_start_of_next_line new set_character_spacing set_horizontal_text_scaling set_spacing_next_line_show_text set_text_leading set_text_matrix_and_text_line_matrix set_word_spacing show_text show_text_with_positioning super_show_text

### Public Class methods

new(main_receiver)

Initialize with the library user‘s receiver

### Public Instance methods

begin_document(root)

Called when the document parsing begins

begin_page(info)

Called when new page parsing begins

begin_page_container(page)
begin_text_object()

PDF operator BT

calculate_line_and_location(new_loc)
end_document()

Called when the document parsing ends

end_page()

Called when page parsing ends

end_page_container()
end_text_object()

PDF operator ET

media_box_check(dict)
move_text_position(tx, ty)

PDF operator Td

move_text_position_and_set_leading(tx, ty)

PDF operator TD

move_to_next_line_and_show_text(string)

PDF operator ‘

move_to_start_of_next_line()

PDF operator T*

set_character_spacing(n)

PDF operator Tc

set_horizontal_text_scaling(n)

PDF operator Tz

set_spacing_next_line_show_text(aw, ac, string)

PDF operator "

set_text_leading(n)

PDF operator TL

set_text_matrix_and_text_line_matrix(a, b, c, d, e, f)

PDF operator Tm

set_word_spacing(n)

PDF operator Tw

show_text(string)

PDF operator Tj

show_text_with_positioning(params)

PDF operator TJ

super_show_text(string)

[Validate]