diff options
author | Seb Bacon <seb.bacon@gmail.com> | 2012-01-18 08:47:35 +0000 |
---|---|---|
committer | Seb Bacon <seb.bacon@gmail.com> | 2012-01-18 08:47:35 +0000 |
commit | ebe06a0d61d9e5a65ef4d4301ed93d92aa35bd5c (patch) | |
tree | 3cf413323bd9a0b6f3dd26ccdf5941286882d141 /app/models/foi_attachment.rb | |
parent | b50adc72e533a9c20aca03063a676f6af4d32b85 (diff) | |
parent | e190eebf7c4bd6a742706e60f2bf941f70d1a1e4 (diff) |
Merge branch 'release/0.5' of github.com:sebbacon/alaveteli into release/0.5
Diffstat (limited to 'app/models/foi_attachment.rb')
-rw-r--r-- | app/models/foi_attachment.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index 20c40abea..74346227b 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -312,13 +312,9 @@ class FoiAttachment < ActiveRecord::Base tempfile.flush if self.content_type == 'application/pdf' - IO.popen("/usr/bin/pdftohtml -nodrm -zoom 1.0 -stdout -enc UTF-8 -noframes " + tempfile.path + "", "r") do |child| - html = child.read() - end + html = AlaveteliExternalCommand.run("pdftohtml", "-nodrm", "-zoom", "1.0", "-stdout", "-enc", "UTF-8", "-noframes", tempfile.path) elsif self.content_type == 'application/rtf' - IO.popen("/usr/bin/unrtf --html " + tempfile.path + "", "r") do |child| - html = child.read() - end + html = AlaveteliExternalCommand.run("unrtf", "--html", tempfile.path) elsif self.has_google_docs_viewer? html = '' # force error and using Google docs viewer else |