Questions tagged [wicked-pdf]

Wicked PDF is a PDF generation plugin for Ruby on Rails using wkhtmltopdf to convert HTML to PDF.

Wicked PDF uses the shell utility wkhtmltopdf to serve a PDF file to a user from HTML. In other words, rather than dealing with a PDF generation DSL of some sort, you simply write an HTML view as you would normally, then let Wicked take care of the hard stuff.

(From wicked_pdf's README)

Resources

  1. Generating PDFs with wicked_pdf
579 questions
11
votes
3 answers

Wicked PDF +fonts+heroku+rails3.2

I'm using wicked_pdf with rails 3.2.11 and ruby 1.9.3 to generate a PDF from HTML and deploying to Heroku. My pdf.css.scss.erb: <% app_fullhost = Constants["app_fullhost"] %> @font-face { font-family:'DosisMedium'; font-style:normal;…
Sten Ka Razin
  • 883
  • 1
  • 10
  • 23
9
votes
1 answer

wicked_pdf does not include styles

I used <%= wicked_pdf_stylesheet_link_tag "pdf" %> it shows the following output in the html
9
votes
2 answers

Wicked_pdf setting footer height or margin on page by page basis

I have been using the Wicked PDF gem for generating pdfs. It has been working great. However, I have run into a situation where a need to attach and have visible a large footer to the first page, but not the rest of the pages. To accomplish this I…
srm
  • 655
  • 1
  • 8
  • 21
9
votes
1 answer

how to load Css in pdf using wicked_pdf

For my rails 4 app i want to convert html and Css into a pdf file. i use the wkhtmltopdf and wicked_pdf gem if i use the wicked helper it doesn't show the css but it render only the text in my controller i have: respond_to do |format| …
JHJ
  • 111
  • 1
  • 1
  • 8
9
votes
3 answers

Rails 4 - how to make a link to a PDF file (name.PDF)?

I am generating PDF files and my link look like this: <%= link_to 'Invoice', display_invoice_path(invoice.id), :format => :pdf %> When I click on this, it takes me to /display_invoice/123456789 (it's an HTML version). In the controller action is…
user984621
  • 46,344
  • 73
  • 224
  • 412
9
votes
1 answer

wkhtmltopdf automatic page breaks

I'm using wkhtmltopdf v0.11.0 rc1 in a Rails application through wicked_pdf (I know wicked_pdf does not support the new command line parameter notation, I'm using my own fork of the gem). I thought that content not fitting within a page should…
HargrimmTheBleak
  • 2,147
  • 1
  • 19
  • 19
9
votes
1 answer

Uninitialized constant Mime::PDF using Wicked PDF gem / Rails 3 project

I'm getting this error when I try to submit my form (PDF is supposed to be generated using Wicked PDF gem, on form submission) - NameError in PostsController#create uninitialized constant Mime::PDF Rails.root:…
hikmatyar
  • 507
  • 1
  • 9
  • 33
8
votes
5 answers

wicked_pdf image rendering

how do I get images of a product to show in pdf? I have this code in view file
<% for asset in @car.assets %> <%= image_tag(asset.asset.url(:medium)) %> <% end %>
and it shows all images for this car. but…
rmagnum2002
  • 11,341
  • 8
  • 49
  • 86
8
votes
4 answers

Wicked-PDF image render with Rails Active Storage

I cannot get wicked_pdf to display an image from active storage to a pdf file. Do I use: wicked_pdf_image_tag or wicked_pdf_asset_base64 or just image_tag in the pdf template. Then do I give a rails_blob_path(company.logo) or just company.logo to…
Kazmin
  • 1,003
  • 1
  • 10
  • 26
8
votes
1 answer

How do I get total pages in wkhtmltopdf body?

Is it possible to access the "topage" variable within the main content body? I know you can do it in headers and footers but in this specific use case, I need to put a sentence within the body that says: "This document contains XX pages".
Heinrich Lee Yu
  • 1,472
  • 15
  • 31
8
votes
3 answers

Wicked_pdf and utf8 symbol

In my generated pdf I get this 0,00 € instead of 0,00 € Application.html.erb show.html.erb <%=number_to_currency item.total%>
sparkle
  • 7,530
  • 22
  • 69
  • 131
8
votes
3 answers

wicked_pdf_image_tag given undefined pathname for image

Hi i am using wicked_pdf for generating images after i save image when i generate pdf and used this tag for display image like this <%= wicked_pdf_image_tag(@image.snap.url(:original)) unless @image.blank? %> it give me this unknown error …
Kashiftufail
  • 10,815
  • 11
  • 45
  • 79
7
votes
3 answers

Embedding SVG in PDF using Wicked_PDF (wkhtmltopdf)

When I try to include an SVG in a PDF generated by wicked_pdf (wkhtmltopdf), it comes out blank. Any idea how to get the svg to display in the pdf? app/views/barcodes/to_pdf.html.haml
Lee Quarella
  • 4,662
  • 5
  • 43
  • 68
7
votes
1 answer

wicked_pdf: footer height/styling

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"} …
polarblau
  • 17,649
  • 7
  • 63
  • 84
7
votes
2 answers

Page break for long table

I have a long table which shows rows on several pages. When a page ends, the row is printed half on one page and half on the next page. How can I make sure that the rows is printed completely on the new page?
John
  • 6,404
  • 14
  • 54
  • 106
1
2
3
38 39