Docsplit Ruby on Rails

I am trying to get docsplit to work with my rails application. Right now I'm just trying to get it to work locally. I installed the gem and all the addictions. All the basic examples work on the command line, and I was able to get

Docsplit.extract_pdf('example.doc') 

to work in my rails application. 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 checked twice and all dependencies are installed. I assume that I missed something in the configuration in rails.

Thanks.

+6
source share
2 answers

Make sure you do not skip the installation step of Poppler as indicated in the docs. http://poppler.freedesktop.org/ Install it using brew install poppler or any other suitable option in your preferred package manager. I had the same error. Installing Poppler fixed it for me.

+5
source

I had the same problem using FreeBSD. I solved this by installing poppler-utils .

+3
source

Source: https://habr.com/ru/post/902041/


All Articles