Wayne Brisette wrote in post #1138927:
> I'm not sure I fully understand... You want to read all the data out of
> a PDF (or just selected data?) and put all that data into a CSV file?
>
> Here's a sample that may be easy for you to understand. This simply goes
> through a PDF and searches for a preset word or phrase and lists the
> page on which it was found in the PDF.

I wrote the code below :

require 'pdf/reader'

File.open("#{__dir__}/a.pdf",'rb') do |io|
  reader = PDF::Reader.new(io)
  reader.pages.each do |page|
    puts page.text
  end
end

It is working. But `text` gives whole page content at a time. Can I read 
the page line by line ?

-- 
Posted via http://www.ruby-forum.com/.