I have a Ruby on Rails 3.2 application using wicked_pdf gem and wkhtmltopdf 0.9.9 to create PDF files on my local machine, which is MAC OSX 10.7.5 Lion . The application successfully renders HTML pages (including SVG images) in the form of PDF files, which is the exact behavior that we strive to run the application.
In local mode, we had to use wkhtmltopdf 0.9.9 due to an error in version 11.0.0 for OSX.
The problem is that when the application is ported to production on Heroku, it must use a different binary: wkhtmltopdf-0.9.9 Linux Static Binary (amd64) , and SVG rendering seems to crash besides. A PDF file is produced, but SVG images are not displayed properly. These are simply empty or square βsinksβ where images should be.
We tried to use the wkhtmltopdf-heroku gem , but continued to receive the "Broken Pipe" error message.
There are no error messages related to this problem, and we do not know where the problem is with the versions of Linux. Any ideas there?
This is our code in config/initializers/wicked_pdf.rb :
if Rails.env.staging? || Rails.env.production? exe_path = Rails.root.join('bin', 'wkhtmltopdf-amd64').to_s else exe_path = Rails.root.join('bin', 'wkhtmltopdf').to_s end
source share