PDF to Text converter using ruby
this script is simpel and pased on an example of the PDF reader
gem (https://github.com/yob/pdf-reader/blob/master/examples/text.rb)
i get all files passed to the script from command line and open each
PDF file then map all pages to the text content and write them to
text file with the same name as the original + txt extension
the gem was raising an error when it fail to get text from a page
so i had to make a workaround and rescue that exception with my hero powers
:D and return an empty text instead.
script is verbose so you'll know all the progress happening while converting
your files.
Written by Emad Elsaid
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#