wicked-pdf

Sending Pdf via email in Rails

别说谁变了你拦得住时间么 提交于 2019-12-22 14:05:47
问题 emp_ids = params[:employee_ids] I am working on a project in rails where i have an Employee List page,This list is the List of Salaryslip of an employee.In that list i have applied checkboxes and at the bottom there is an Send button.I want that if i select multiple checkboxes,Email should be gone to all the employees including the pdf of salary slip.I am able to do this if i select checkbox the on clicking on submit all the salaryslip come for the employee who i have selected but in that pdf

`undefined method `find_asset' for nil:NilClass`

对着背影说爱祢 提交于 2019-12-22 04:50:27
问题 I am using 'rails', '4.2.5' and wicked_pdf gem for generating and downloading PDF, but on Heroku, it's not including css using wicked_pdf_stylesheet_link_tag tag. Heroku error log: ActionView::Template::Error (undefined method 'find_asset' for nil:NilClass) Did I miss any configuration here? 回答1: To get it work for development and production environment don't use Rails.application.assets.find_asset(logical_file_path).to_s for sprockets-rails version > 3.0.0 but use this (requires gem compass

Wicked_pdf working fine in development, but not in production

两盒软妹~` 提交于 2019-12-21 21:36:24
问题 I've been working with wicked_pdf to generate some PDFs in Rails, and it's been working fine in my dev environment, but I get a 500 error (but no specific errors in my log) when I try and generate one on my production environment. The first thing I noticed was that the wkhtmltopdf binary was in a different location on my production box, so I've added the following to my wicked_pdf.rb initializer: if Rails.env == "production" WickedPdf.config = { :exe_path => '/usr/bin/wkhtmltopdf' } end Here

Rails 4 wicked_pdf saving pdf on server in model

依然范特西╮ 提交于 2019-12-21 12:58:06
问题 I'm trying to save pdf in model like this: def save_invoice pdf = WickedPdf.new.pdf_from_string( render_to_string(:pdf => "invoice",:template => 'documents/show.pdf.erb') ) save_path = Rails.root.join('pdfs','filename.pdf') File.open(save_path, 'wb') do |file| file << pdf end end I did in in payment.rb model after I save my Payment object. Get an error: undefined method `render_to_string' for <Payment object> Earlier did it in controller without problem def show @user = @payment.user

Highcharts does not work with wicked_pdf

社会主义新天地 提交于 2019-12-21 05:10:05
问题 I'm trying to generate a PDF report using the Wicked_pdf gem and Highcharts. I've already tried to set animation , enableMouseTracking and shadow false. But when wkhtmltopdf tries to generated the PDF files I got an error. I really don't not what to do, because when I do the same procedure for an HTML, Highcharts renders perfectly. 回答1: I fixed it by setting this options: plotOptions: line: animation: false enableMouseTracking: false shadow: false Also, don't forget to include JQuery and

wicked_pdf does not run on Ubuntu server : wkhtmltopdf: cannot connect to X server

随声附和 提交于 2019-12-20 09:04:02
问题 I'm trying to use wicked_pdf on my prod server but it keeps failling : RuntimeError (Failed to execute: "/usr/bin/wkhtmltopdf" -q "file:////tmp/wicked_pdf20130709-23109-1adqx5g.html" "/tmp/wicked_pdf_generated_file20130709-23109-1ic5dbe.pdf" Error: PDF could not be generated! Command Error: wkhtmltopdf: cannot connect to X server ): app/controllers/contrats_controller.rb:15:in `block (2 levels) in show' app/controllers/contrats_controller.rb:11:in `show' I tried to follow this answer :

wicked_pdf font size too large in production

雨燕双飞 提交于 2019-12-19 10:12:32
问题 I am experiencing an issue where the font sizing for rendered PDFs is larger in production . Everything looks great on the PDF generated in development. Here is the rendering from development : Here is the rendering from production : This is making it very difficult for me to format my document for the production server in development. Can you please take a look? HTML Version: http://www.hearingtracker.com/tickets/170 PDF Download: http://www.hearingtracker.com/tickets/170.pdf Here is my

wicked_pdf: footer height/styling

半世苍凉 提交于 2019-12-19 02:04:14
问题 I'm using the awesome wicked_pdf gem to generate a PDF, but I can't figure out how to change certain styles within the footer. I'm having a HAML template for the footer looking roughly like this: !!! %html %head %meta{:charset => "utf-8"} = wicked_pdf_stylesheet_link_tag "pdf" %body .footer %p Line 1 %p Line 2 %p Line 3 And some styles: .footer { padding-top: 1em; border-top: 1px solid #ccc; } The styles are applied just fine, but the due to a small height of the footer, only the first line

wkhtmltopdf RuntimeError (Location of wkhtmltopdf unknown)

爷,独闯天下 提交于 2019-12-18 16:33:07
问题 I am using Ubuntu 11.04 to develop an app in Ruby on Rails. In the app I need to generate pdf documents. So I am using the wicked_pdf and wkhtmltopdf-binary gems. In the development environment in my system everything is working fine. But once I deployed the app in production on CentOS 5.6 using Phusion Passenger, when I try to generate pdfs on the fly its giving me the following error: RuntimeError (Location of wkhtmltopdf unknown) I am using Ruby1.9.2.p136 Rails 3.1.1 Any help will be much

wkhtmltopdf RuntimeError (Location of wkhtmltopdf unknown)

血红的双手。 提交于 2019-12-18 16:32:14
问题 I am using Ubuntu 11.04 to develop an app in Ruby on Rails. In the app I need to generate pdf documents. So I am using the wicked_pdf and wkhtmltopdf-binary gems. In the development environment in my system everything is working fine. But once I deployed the app in production on CentOS 5.6 using Phusion Passenger, when I try to generate pdfs on the fly its giving me the following error: RuntimeError (Location of wkhtmltopdf unknown) I am using Ruby1.9.2.p136 Rails 3.1.1 Any help will be much