Skip to content

Commit e2d8c2d

Browse files
committed
Docsplit 0.4.1 -- add office.home system property for Ubuntu.
1 parent 65bd1fe commit e2d8c2d

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

docsplit.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'docsplit'
3-
s.version = '0.4.0' # Keep version in sync with docsplit.rb
3+
s.version = '0.4.1' # Keep version in sync with docsplit.rb
44
s.date = '2010-8-23'
55

66
s.homepage = "http://documentcloud.github.com/docsplit/"

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ <h1>Doc<sub style="font-size:150%;">&#9889;</sub>split</h1>
9898
(title, author, number of pages...)
9999
</p>
100100

101-
<p>Docsplit is currently at <a href="http://rubygems.org/gems/docsplit">version 0.4.0</a>.</p>
101+
<p>Docsplit is currently at <a href="http://rubygems.org/gems/docsplit">version 0.4.1</a>.</p>
102102

103103
<p>
104104
<i>Docsplit is an open-source component of <a href="http://documentcloud.org/">DocumentCloud</a>.</i>
@@ -280,7 +280,7 @@ <h2 id="internals">Internals</h2>
280280
<h2 id="changes">Change Log</h2>
281281

282282
<p>
283-
<b class="header">0.4.0</b><br />
283+
<b class="header">0.4.1</b><br />
284284
Upgraded the JODConverter dependency for PDF conversion via OpenOffice to
285285
3.0 beta. Added PNG, GIF, TIF, JPG, and BMP to the list of supported
286286
formats.

lib/docsplit.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The Docsplit module delegates to the Java PDF extractors.
22
module Docsplit
33

4-
VERSION = '0.4.0' # Keep in sync with gemspec.
4+
VERSION = '0.4.1' # Keep in sync with gemspec.
55

66
ROOT = File.expand_path(File.dirname(__FILE__) + '/..')
77

@@ -11,6 +11,8 @@ module Docsplit
1111

1212
HEADLESS = "-Djava.awt.headless=true"
1313

14+
OFFICE = RUBY_PLATFORM.match(/darwin/i) ? '' : '-Doffice.home=/usr/lib/openoffice'
15+
1416
METADATA_KEYS = [:author, :date, :creator, :keywords, :producer, :subject, :title, :length]
1517

1618
DEPENDENCIES = {:java => false, :gm => false, :pdftotext => false, :pdftk => false, :tesseract => false}
@@ -76,7 +78,7 @@ def self.extract_#{key}(pdfs, opts={})
7678
# Runs a Java command, with quieted logging, and the classpath set properly.
7779
def self.run(command, pdfs, opts, return_output=false)
7880
pdfs = [pdfs].flatten.map{|pdf| "\"#{pdf}\""}.join(' ')
79-
cmd = "java #{HEADLESS} #{LOGGING} -cp #{CLASSPATH} #{command} #{pdfs} 2>&1"
81+
cmd = "java #{HEADLESS} #{LOGGING} #{OFFICE} -cp #{CLASSPATH} #{command} #{pdfs} 2>&1"
8082
result = `#{cmd}`.chomp
8183
raise ExtractionFailed, result if $? != 0
8284
return return_output ? (result.empty? ? nil : result) : true

0 commit comments

Comments
 (0)