Permalink
Browse files

Add Grim MultiProcessor support.

This helps us handle a broader range of PDFs that might not otherwise process because of the version of GhostScript provided on Heroku's Cedar stack.
  • Loading branch information...
1 parent 6f17e82 commit 5036a78089cd70c26fcdb836f0b8412b520dab89 @jonmagic jonmagic committed Oct 21, 2011
Showing with 8 additions and 0 deletions.
  1. BIN bin/9.02/gs
  2. BIN bin/9.04/gs
  3. +8 −0 lib/pdf_archive.rb
View
BIN bin/9.02/gs
Binary file not shown.
View
BIN bin/9.04/gs
Binary file not shown.
View
8 lib/pdf_archive.rb
@@ -38,6 +38,14 @@ def self.root
config.fog_attributes = {'Cache-Control'=>'max-age=315576000'} # optional, defaults to {}
end
+# Grim Production Config
+if PdfArchive.environment == "production"
+ Grim.processor = Grim::MultiProcessor.new([
+ Grim::ImageMagickProcessor.new({:ghostscript_path => PdfArchive.root.join('bin', '9.04', 'gs')}),
+ Grim::ImageMagickProcessor.new({:ghostscript_path => PdfArchive.root.join('bin', '9.02', 'gs')})
+ ])
+end
+
# require pdf uploader, document model, and process pdf job
require 'pdf_uploader'
require 'document'

0 comments on commit 5036a78

Please sign in to comment.