1

Summarize what is going on:

OSX: 10.8.4, wkhtmltopdf: 0.9.1 (via gem wkhtmltopdf-binary), pdfkit: 0.5.4

When submitting a link over with the pdf format, the dock displays a terminal icon for wkhtmltopdf and rails server hangs. Generally clicking the wkhtmltopdf on the dock will unhang the application, but this is not the case for me.

Our rack config is:

config.middleware.use PDFKit::Middleware, {}, :only => [%r[^/admin/snailers/\d*/download_snailer.pdf.*/], "/admin/activities/transactions_on_and_offline_report"]

Here is the controller method:

def transactions_on_and_offline_report
  @transactions = Transaction.find(:all, joins: [:transaction_type], 
  conditions: {transactions: { created_at: (Date.parse(params[:filter][:start_date]))..(Date.parse(params[:filter][:end_date])) }})
end

The link

transactions_on_and_offline_report_admin_activities_path(format: :pdf)

I feel like I have covered all my bases here and this should work, but I'm striking out right now. Does anyone see something I should change or try?

Packersville
  • 73
  • 2
  • 8
  • Most common case for hanging is when you're loading assets (css, js, images) from the same server that's generating the PDF. Try to remove all assets from your layout/view, and render again. If the process goes through, then most likely you've defined your asset paths locally; you can change to absolute paths to fix the problem. – Arman H Aug 02 '13 at 17:42
  • Have you managed to find a solution to this issue? I can lick the icon to dissmiss the problem, but it makes it pretty much unusable, when one has to generate lots of documents... – mdrozdziel Feb 25 '15 at 15:13

0 Answers0