Why texts are jumbled using PDF-reader

I am using pdf-reader gem and trying to look for some content at some
particular position on PDF. So what I am doing..

require 'rubygems'
require 'pdf-reader'
reader = PDF::Reader.new("general.pdf")
page1=reader.page(1)
page1_txt=page1.to_s

In page1_txt I can see that Words or the blanks in PDF which is filled,
are not in the order we expect looking at PDF. Why this happens? and how
to take care of that, So I can be definite to say that s1 string can
only be searched between s2 and s3.

any other better gem to look for string in particular position in pdf?

···

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

I can't even find that one :frowning:

C:\Users\test\Desktop>gem install pdf-reader
ERROR: Could not find a valid gem 'pdf-reader' (>= 0) in any repository
ERROR: Possible alternatives: pdf-reader

···

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

Joel Pearson wrote in post #1084721:

I can't even find that one :frowning:

C:\Users\test\Desktop>gem install pdf-reader
ERROR: Could not find a valid gem 'pdf-reader' (>= 0) in any repository
ERROR: Possible alternatives: pdf-reader

OR
https://www.google.co.in/search?client=ubuntu&channel=fs&q=could+not+find+valid+gem&ie=utf-8&oe=utf-8&redir_esc=&ei=RrWmUL2tHsLwrQeCxoCYCA

···

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

any idea? why it happens? or any solution?

···

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