lib/docsplit.rb in docsplit-0.3.4 vs lib/docsplit.rb in docsplit-0.4.0

- old
+ new

@@ -1,9 +1,9 @@ # The Docsplit module delegates to the Java PDF extractors. module Docsplit - VERSION = '0.3.4' # Keep in sync with gemspec. + VERSION = '0.4.0' # Keep in sync with gemspec. ROOT = File.expand_path(File.dirname(__FILE__) + '/..') CLASSPATH = "#{ROOT}/build#{File::PATH_SEPARATOR}#{ROOT}/vendor/'*'" @@ -52,10 +52,11 @@ # Use JODCConverter to extract the documents as PDFs. def self.extract_pdf(docs, opts={}) [docs].flatten.each do |doc| basename = File.basename(doc, File.extname(doc)) - run "-jar #{ROOT}/vendor/jodconverter/jodconverter-cli-2.2.2.jar #{doc} #{opts[:output] || '.'}/#{basename}.pdf", [], {} + options = "-jar #{ROOT}/vendor/jodconverter/jodconverter-core-3.0-beta-3.jar -r #{ROOT}/vendor/conf/document-formats.js" + run "#{options} \"#{doc}\" \"#{opts[:output] || '.'}/#{basename}.pdf\"", [], {} end end # Define custom methods for each of the metadata keys that we support. # Use the ExtractInfo Java class to print out a single bit of metadata.