# Text extraction from PDF files (non-European languages)...?

**URL:** <https://www.ruby-forum.com/t/text-extraction-from-pdf-files-non-european-languages/76841>\
**Category:** Ruby\
**Created:** [November 21, 2006, 6:06pm UTC](https://www.ruby-forum.com/t/text-extraction-from-pdf-files-non-european-languages/76841 "2006-11-21T18:06:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 21, 2006, 6:06pm UTC](https://www.ruby-forum.com/t/text-extraction-from-pdf-files-non-european-languages/76841/1 "2006-11-21T18:06:02Z")

</div>

Dear all,

is there a way of extracting text from a PDF, if the latter  
is in some non-European language, such as Arabic or  
Chinese?  
Under Linux, I have been able to use Ruby in conjunction  
with pdftotext for English and other Latin1 encoded texts -  
with some problems sometimes for special characters,  
but it doesn’t seem to work for Unicode …

Is there a Ruby way to do this ?

Thank you!

Best regards,

Axel

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 22, 2006, 1:53am UTC](https://www.ruby-forum.com/t/text-extraction-from-pdf-files-non-european-languages/76841/2 "2006-11-22T01:53:37Z")

</div>

Hi,

2006/11/22, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> is there a way of extracting text from a PDF, if the latter  
> is in some non-European language, such as Arabic or  
> Chinese?  
> Under Linux, I have been able to use Ruby in conjunction  
> with pdftotext for English and other Latin1 encoded texts -  
> with some problems sometimes for special characters,  
> but it doesn’t seem to work for Unicode …

Which version of pdftotext did you use? Xpdf or poppler?  
You need to install character map files for other Latin1 encoded  
texts.

> Is there a Ruby way to do this ?

You can use Ruby/Poppler if poppler doesn’t have any problem:  
[CVS Info for project ruby-gnome2](http://ruby-gnome2.cvs.sourceforge.net/ruby-gnome2/ruby-gnome2/poppler/sample/pdf2text.rb?revision=HEAD&view=markup)

Thanks,

---

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [November 21, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/text-extraction-from-pdf-files-non-european-languages/76841/3 "2006-11-21T18:16:06Z")

</div>

Axel

On 11/21/06, removed\_email\_address@domain.invalid [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> is there a way of extracting text from a PDF, if the latter  
> is in some non-European language, such as Arabic or  
> Chinese?

rpdf2txt (1) _should_ work with Unicode PDF-Documents. If you run into  
any problems let me know, I’m happy to tinker with the beast.

[http://download.ywesee.com/rpdf2txt/rpdf2txt-1.0.6.tar.bz2](http://download.ywesee.com/rpdf2txt/rpdf2txt-1.0.6.tar.bz2)  
[http://raa.ruby-lang.org/project/rpdf2txt/](http://raa.ruby-lang.org/project/rpdf2txt/)

hth

Hannes
