![]() tried swapping PDFKit for wicked_pdf and encountered the same problem (hanging, but when Rails process is killed the PDF renders as expected).tested wkhtmltopdf google.pdf and it generated a PDF of the Google homepage as expected.added config.threadsafe! to config/environments/development.rb for multiple threads so asset pipeline doesn't conflict with PDF engine.pdf mime-type in my mime_types.rb initializer with Mime::Type.register_alias "application/pdf", :pdf included gem 'pdfkit' in my Gemfile and installed it with Bundler. ![]() ![]() used the PDFKit middleware by loading "PDFKit::Middleware" in my application.rb file.wkhtmltopdf: 0.11.0_rc1 (although when I run wkhtmltopdf -V it says 0.10.0_rc2).pdf version of my view (I'm using the PDFKit Middleware option) my browser just sits there waiting for a response, but as soon as I kill the Rails process the PDF I expected to get only then pops up in my browser window. I installed everything, tested wkhtmltopdf on the CLI with no problems, fiddled around with Rails settingsto run multiple processes so the asset pipeline works, and all seemed good, except I'm still stuck at the very end of the process (actually getting the PDF response from the server). So I found a screencast by Ryan on how to use PDFKit. It also seems like the PDFKit and wicked_pdf gems for Rails are the new cool. After reading around it seemed to me that Prawn is out and wkhtmltopdf is in.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |