Class: PDF::Reader::Turtletext::Textangle
- Inherits:
-
Object
- Object
- PDF::Reader::Turtletext::Textangle
- Defined in:
- lib/pdf/reader/turtletext/textangle.rb
Overview
A DSL syntax for text extraction. WIP - not using this yet
textangle = PDF::Reader::Turtletext::Textangle.new(reader) do
page 1
below "Electricity Services"
above "Gas Services by City Gas Pte Ltd"
right_of 240.0
left_of "Total ($)"
end textangle.text
Instance Attribute Summary collapse
-
#above ⇒ Object
writeonly
Sets the attribute above.
-
#below ⇒ Object
writeonly
Sets the attribute below.
-
#left_of ⇒ Object
writeonly
Sets the attribute left_of.
-
#page ⇒ Object
writeonly
Sets the attribute page.
-
#reader ⇒ Object
readonly
Returns the value of attribute reader.
-
#right_of ⇒ Object
writeonly
Sets the attribute right_of.
Instance Method Summary collapse
-
#initialize(structured_reader, &block) ⇒ Textangle
constructor
structured_reader
is a PDF::StructuredReader. - #text ⇒ Object
Constructor Details
#initialize(structured_reader, &block) ⇒ Textangle
structured_reader
is a PDF::StructuredReader
18 19 20 21 |
# File 'lib/pdf/reader/turtletext/textangle.rb', line 18 def initialize(structured_reader,&block) @reader = structured_reader instance_eval( &block ) if block end |
Instance Attribute Details
#above=(value) ⇒ Object (writeonly)
Sets the attribute above
15 16 17 |
# File 'lib/pdf/reader/turtletext/textangle.rb', line 15 def above=(value) @above = value end |
#below=(value) ⇒ Object (writeonly)
Sets the attribute below
15 16 17 |
# File 'lib/pdf/reader/turtletext/textangle.rb', line 15 def below=(value) @below = value end |
#left_of=(value) ⇒ Object (writeonly)
Sets the attribute left_of
15 16 17 |
# File 'lib/pdf/reader/turtletext/textangle.rb', line 15 def left_of=(value) @left_of = value end |
#page=(value) ⇒ Object (writeonly)
Sets the attribute page
15 16 17 |
# File 'lib/pdf/reader/turtletext/textangle.rb', line 15 def page=(value) @page = value end |
#reader ⇒ Object (readonly)
Returns the value of attribute reader.
14 15 16 |
# File 'lib/pdf/reader/turtletext/textangle.rb', line 14 def reader @reader end |
#right_of=(value) ⇒ Object (writeonly)
Sets the attribute right_of
15 16 17 |
# File 'lib/pdf/reader/turtletext/textangle.rb', line 15 def right_of=(value) @right_of = value end |
Instance Method Details
#text ⇒ Object
23 24 25 |
# File 'lib/pdf/reader/turtletext/textangle.rb', line 23 def text # TODO end |