# Extract contents from pdf (pdf reader)

**URL:** <https://www.ruby-forum.com/t/extract-contents-from-pdf-pdf-reader/149162>\
**Category:** Ruby\
**Created:** [September 22, 2008, 5:37am UTC](https://www.ruby-forum.com/t/extract-contents-from-pdf-pdf-reader/149162 "2008-09-22T05:37:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![P\_Rajmohan\_BSA1719](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/13edae/32.png) [@P\_Rajmohan\_BSA1719](https://www.ruby-forum.com/u/P_Rajmohan_BSA1719)\
**Post date:** [September 22, 2008, 5:37am UTC](https://www.ruby-forum.com/t/extract-contents-from-pdf-pdf-reader/149162/1 "2008-09-22T05:37:50Z")

</div>

Hi,

I am looking for a way to read the contents of the pdf document. Could  
you pls advice on how to go about it? I have tried using the pdf-reader  
gem but ran into issues. Are there any other gems out there?

The issue I am facing with pdf-reader is - I installed 0.7.5 gem on  
Windows and am having 1.8.6 version of ruby. Now there seems to be some  
issue with the 0.7.5 version and hence downgraded to 0.7.3 as per the  
suggestions of the gem author in one of his replies on the mailing list.  
But even with 0.7.3, I am seeing the same issue. Am I missing something?

D:\Profiles\admin\My Documents\>ruby pdf\_reader\_test.rb  
c:/ruby/lib/ruby/gems/1.8/gems/pdf-reader-0.7.3/lib/pdf/reader/content.r  
b:430:in `page\_count’: wrong number of arguments (1 for 0)  
(ArgumentError)

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![P\_Rajmohan\_BSA1719](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/13edae/32.png) [@P\_Rajmohan\_BSA1719](https://www.ruby-forum.com/u/P_Rajmohan_BSA1719)\
**Post date:** [September 22, 2008, 4:00pm UTC](https://www.ruby-forum.com/t/extract-contents-from-pdf-pdf-reader/149162/2 "2008-09-22T16:00:56Z")

</div>

On Sun, Sep 21, 2008 at 11:29 PM, P Rajmohan B.-A17190  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> I am looking for a way to read the contents of the pdf document. Could  
> you pls advice on how to go about it? I have tried using the pdf-reader  
> gem but ran into issues. Are there any other gems out there?

AFAIK PDF::Reader is the only serious option, and I see you’ve posted  
on the PDF::Reader mailing list so I’m sure James will get back to you  
soon.

-greg
