Class: PDF::Reader::MarkupPage

Inherits:
Object
  • Object
show all
Defined in:
lib/pdf/reader/markup.rb,
lib/pdf/reader/markup/version.rb,
lib/pdf/reader/markup/page_bold_italic_receiver.rb

Overview

:doc:

Defined Under Namespace

Classes: PageBoldItalicReceiver

Constant Summary collapse

VERSION =
"0.0.1"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ MarkupPage

Wrapper function for walking the page with the Reader::MarkupPage::PageBoldItalicReceiver receiver



29
30
31
32
33
34
35
36
# File 'lib/pdf/reader/markup.rb', line 29

def initialize(page)
  receiver = PageBoldItalicReceiver.new()
  page.walk(receiver)
  @content = receiver.content
  @markup = receiver.markup
  @lines = @content.lines.to_a
  @formatted_lines = @markup.lines.to_a
end

Instance Attribute Details

#contentObject (readonly)

Returns the plaintext content of the page



10
11
12
# File 'lib/pdf/reader/markup.rb', line 10

def content
  @content
end

#formatted_linesObject (readonly)

Returns the formatted lines for the page as an array



15
16
17
# File 'lib/pdf/reader/markup.rb', line 15

def formatted_lines
  @formatted_lines
end

#linesObject (readonly)

Returns the plaintext lines for the page as an array



20
21
22
# File 'lib/pdf/reader/markup.rb', line 20

def lines
  @lines
end

#markupObject (readonly)

Returns the formatted content of the page



24
25
26
# File 'lib/pdf/reader/markup.rb', line 24

def markup
  @markup
end