documentcloud / docsplit

Break Apart Documents into Images, Text, Pages and PDFs
http://documentcloud.github.com/docsplit/
Other
833 stars 214 forks source link

Can any one please tell me how to pass file path as url to Docsplit ? #138

Closed jogiranjith closed 8 years ago

jogiranjith commented 8 years ago

I am using s3 to store images . For splitting the documents in to images i need to pass s3 url . Docsplit throws me an error saying the file not found any help please .

ex: Docsplit.extract_images(url,:format => [:jpg])

nruth commented 8 years ago

Download a local copy as a tempfile to process, e.g. using something like https://viget.com/extend/make-remote-files-local-with-ruby-tempfile

jogiranjith commented 8 years ago

yeah @nruth thanks i have done it in the same way .

ex: require 'open-uri' uri = URI.parse(url) file = open(uri) Docsplit.extract_images(file.path,:size => "794x",:format => [:jpg],:output => output_path )