Docsplit Ruby on Rails
Asked Answered
H

2

7

I'm trying to get docsplit to work with my rails app. Right now I'm just trying to get it to run locally. I installed the gem and all of the dependencies. All of the basic examples work in the command line and I was able to get the

Docsplit.extract_pdf('example.doc')

to work in my rails app. However when I try to use extract_images, i.e.

Docsplit.extract_images('example.doc', :size => '1000x', :format => [:png, :jpg])

I get the following error:

Docsplit::ExtractionFailed (sh: pdfinfo: command not found):
  docsplit (0.6.1) lib/docsplit/info_extractor.rb:23:in `extract'
  (eval):3:in `extract_length'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:34:in `convert'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:19:in `extract'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:19:in `each'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:19:in `extract'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:18:in `each'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:18:in `each_with_index'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:18:in `extract'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:16:in `each'
  docsplit (0.6.1) lib/docsplit/image_extractor.rb:16:in `extract'
  docsplit (0.6.1) lib/docsplit.rb:58:in `extract_images'
  app/controllers/sandbox_controller.rb:53:in `split_doc'

I double checked and all of the dependencies are installed. I'm guessing I missed something in the configuration in rails.

Thanks.

Hearthstone answered 21/11, 2011 at 19:6 Comment(0)
E
5

Make sure you don't skip the step of installing Poppler, as mentioned in the docs. http://poppler.freedesktop.org/ Install it with brew install poppler or whatever's appropriate in your preferred package manager. I had this same error. Installing Poppler fixed it for me.

Emmanuelemmeline answered 21/11, 2011 at 22:13 Comment(0)
O
3

I was having the same problem using FreeBSD. I solved it by installing poppler-utils.

Outstand answered 28/2, 2012 at 22:42 Comment(2)
Thanks, running Centos on Amazon EC2 and this was it.Agglomeration
This also solved it for me running Amazon Linux 2014.03Alexi

© 2022 - 2024 — McMap. All rights reserved.