wicked-pdf

wicked_pdf footer not working

我的未来我决定 提交于 2020-01-03 17:47:56
问题 I've got little problem with wicked_pdf footer render. Here is my render method: def invoice render pdf: "#{@order.number}.pdf", footer: { html: { template: "admin/orders/invoice_footer.html" } }, margin: { bottom: 25 } end PDF render works OK, but there is no footer template. I tried different margins in wicked settings, but with no success. 回答1: Just had this same issue, the problem seemed to be that my wkhtmltopdf install did not generate the footers as requested. The version I had was

wicked_pdf footer not working

我是研究僧i 提交于 2020-01-03 17:46:20
问题 I've got little problem with wicked_pdf footer render. Here is my render method: def invoice render pdf: "#{@order.number}.pdf", footer: { html: { template: "admin/orders/invoice_footer.html" } }, margin: { bottom: 25 } end PDF render works OK, but there is no footer template. I tried different margins in wicked settings, but with no success. 回答1: Just had this same issue, the problem seemed to be that my wkhtmltopdf install did not generate the footers as requested. The version I had was

wicked pdf not displaying amazon s3 images

吃可爱长大的小学妹 提交于 2020-01-02 11:05:16
问题 A very strange thing has happended to my app recently and not sure what has changed? wicked pdf is not longer displaying my https:// images from my amazon s3 server. I am using the images with the src= "https://pathtoimage.png" and they were displaying just find before. The displaying of images is not working locally or on heroku. On my production server, the pdf rendering is not working as well and creating a bunch of blank white pages. I am using the gem gem 'wkhtmltopdf-binary' gem 'wicked

Getting error PDF could not generated in Rails 3

走远了吗. 提交于 2019-12-25 03:34:33
问题 I am getting the following error while converting the HTML file to PDF using wicked_pdf gem in Rails 3. error: Error: Failed to execute: ["C:\\Program Files\\wkhtmltopdf\\bin\\wkhtmltopdf.exe", "file://C:/DOCUME~1/SUBHRA~1/LOCALS~1/Temp/wicked_pdf20150526-648-17uza61.html", "C:/DOCUME~1/SUBHRA~1/LOCALS~1/Temp/wicked_pdf_generated_file20150526-648-w6l9ye.pdf"] Error: PDF could not be generated! Command Error: Loading pages (1/6) [> ] 0% [======> ] 10% Error: Failed loading page file://c/DOCUME

Wicked_pdf too few arguments in demo

喜你入骨 提交于 2019-12-24 12:33:21
问题 I'm trying to get wicked_pdf working for the first time as a project in learning RoR, but i've run into an issue. When I try to run any of the demo's I've read around the place using the format.pdf do command, I get the error " Too few arguments " with highlighting on the format.pdf do line. This is the code: def show format.pdf do render :pdf => "file_name", :template => 'certificates/show.pdf.erb' end end What am I missing? 回答1: try this.. I had same problem. def show #format.pdf do render

wicked_pdf not loading header or footer in ActionMailer

假装没事ソ 提交于 2019-12-24 07:38:31
问题 I'm trying to generate a pdf with the following code: archivo = render_to_string( :pdf => "formulario_de_registro.pdf", :template => 'pdf/profile_download.pdf.haml', :layout => 'pdf/body.pdf.haml', :margin => { :bottom => 40, :top => 30 }, :header => { :html => { :template => 'layouts/pdf/header.pdf.haml'}, :font_size => 13}, :footer => { :html => { :template => 'layouts/pdf/footer.pdf.haml'}, :line => true} ) # from here is just for debugging purposes save_path = Rails.root.join('tmp',

Rails views helper don't seems to work with render_to_string

大憨熊 提交于 2019-12-24 06:28:14
问题 I try to convert rails views into pdf with the gem wicked_pdf. But when I do a render_to_string like this ActionController::Base.new.render_to_string(template: "templates/pdf_meteo.html.erb", locals: {communaute_meteo_id: id}, layout: 'pdf') Methods like user_path don't work and return undefined method error... (note that the page work properly if I render it in html) If someone can help me ! 回答1: Unfortunately, using render_to_string will not give you access to Rails URL helpers. One

Rails views helper don't seems to work with render_to_string

空扰寡人 提交于 2019-12-24 06:28:13
问题 I try to convert rails views into pdf with the gem wicked_pdf. But when I do a render_to_string like this ActionController::Base.new.render_to_string(template: "templates/pdf_meteo.html.erb", locals: {communaute_meteo_id: id}, layout: 'pdf') Methods like user_path don't work and return undefined method error... (note that the page work properly if I render it in html) If someone can help me ! 回答1: Unfortunately, using render_to_string will not give you access to Rails URL helpers. One

wicked_pdf / wkhtml - support for css tables using tr.odd and tr.even to change background colour

≯℡__Kan透↙ 提交于 2019-12-24 00:55:35
问题 Does the wicked_pdf gem/plugin and the underlying wkhtmltopdf provide support for striping of alternating columns using css of tbody, tr.even and the corresponding tr.odd? I have this in my css file (in the public folder) but its not rendering the colours properly. table { width: 90%; border: 1px solid #999999; } th, td { padding: 7px 10px 10px 10px; } th { border-bottom: 2px solid #111111; border-top: 1px solid #999999; font-size: 90%; /* letter-spacing: 0.1em; */ text-align: left; text

Sending email with attachments

梦想与她 提交于 2019-12-23 09:16:02
问题 I've got a mailer that as follows: class Payments::LateNoticesMailer < AsyncMailer def notice(payment_id) @payment = PaymentDecorator.find(payment_id) @invoice = @payment.invoice template = "payments/invoices/#{@payment.made_with_type.downcase}/show" attachments["#{@payment.invoice_filename}.pdf"] = WickedPdf.new.pdf_from_string( render_to_string( pdf: @payment.invoice_filename, formats: [:pdf], template: template, layout: "layouts/pdf.html")) mail to: @payment.payer_email, from: '