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
5
votes
2 answers

wicked_pdf: ActionView::Template::Error (couldn't find file 'twitter/bootstrap'

We have some PDF generation code working fine in the dev environment, but Rails is showing an error when we try to render it on production: ***************WICKED*************** Rendered invoices/show.pdf.haml within layouts/invoices_pdf.pdf…
okeen
  • 3,976
  • 2
  • 15
  • 19
5
votes
2 answers

HTML to PDF with Wicked PDF and letter-spacing issues

Using both 0.79 and 0.7.2 the PDF generated looks slightly different than my original HTML. Adding the show_as_html flag presents it as expected however the inline-styles are being handled differently in the PDF then they are in the HTML…
yekta
  • 3,363
  • 3
  • 35
  • 50
5
votes
1 answer

WickedPDF missing layout

I have a controller like this: def show @professor = Professor.find(params[:id]) respond_to do |format| format.html format.pdf do render :pdf => "file_name" end end end And a simple view like…
Hommer Smith
  • 26,772
  • 56
  • 167
  • 296
5
votes
3 answers

How to save pdf file inside the public folder using wicked_pdf

Right Now i am using Rails 3.0.0.i already installed the gem wicked_pdf.Now to want to save the pdf file inside the public folder.please help me.
4
votes
2 answers

wicked_pdf on production server

Locally It works like magic but when I try to generate the PDF on the server it trows: RuntimeError (Failed to execute: "/path/to/my/project/vendor/bundle/ruby/1.9.1/bin/wkhtmltopdf" -q - - Error: Broken pipe): Here's what's on…
Mr_Nizzle
  • 6,644
  • 12
  • 55
  • 85
4
votes
2 answers

wkhtmltopdf: Page breaks and multi column layouts doesn't work

I am using wkhtmltopdf(11.0_rc1) via wicked_pdf gem. I am noticing that the multi column layouts doesn't play well with page breaks. I also noticed the behavior varies between CentOS(on Heroku) and Windows. On Windows, page break is honored in some…
Harish Shetty
  • 64,083
  • 21
  • 152
  • 198
4
votes
1 answer

Is it possible to use jQuery in wicked_pdf to render charts?

I want to render graphs created by HighCharts, which used jQuery, in the PDF that wicked_pdf generates. I've looked at the plugin website and it seems like there is a way to do it, I just can't figure it out. My charts work fine in the regular html…
FattRyan
  • 906
  • 2
  • 12
  • 26
4
votes
4 answers

Wicked_PDF Download Only - Rails 3.1

I currently run Rails 3.1 and am using the latest version of Wicked_pdf for PDF generation. I have set everything up correctly, and PDFs are generated just fine. However, I want the user to be able to click a button to DOWNLOAD the pdf. At the…
Ammar
  • 1,091
  • 12
  • 23
4
votes
2 answers

ROR: Image not getting rendered in wicked_pdf's pdf

Here I am not talking about the images with wicked_pdf_image_tag. Those are working well. But when I download the pdf then it isn't rendering the image. It is rendering like a small box. Click here File.html.haml %img{src:…
User
  • 169
  • 1
  • 11
4
votes
0 answers

wicked_pdf doesn't work after rails update

Hi this is not a question, but a solution for a problem :) I updated rails from 5.1.x to 5.2.x, at this new rails version by default updates sprockets from 3.x.x to 4.x.x version. Therefor if you are using wicked_pdf gem older version you might…
r2d
  • 41
  • 1
  • 5
4
votes
1 answer

wicked_pdf_image_tag resolves to public folder when looking for images

I want to render an image that a user uploads in a PDF. I am saving the image to the current Rails directory public folder. Images are being saved at the moment inside the public folder. Everything works in development but when in production, it is…
4
votes
2 answers

Wicked PDF - showing fontawesome icons as sqaure box

I am using wicked-pdf gem (v1.2.2) to generate a PDF report which contains a font awesome icon. I have kept the fontawesome file in this path: vendor/assets/fonts/fontawesome.css.erb and corresponding fonts in this…
dp7
  • 6,651
  • 1
  • 18
  • 37
4
votes
3 answers

Wicked PDF header not showing up

After already checking the Rails Gem repository for similar issues as well as Stack Overflow, I couldn't find an answer to my problem. I'm trying to render a pdf using wicked_pdf within a Rails controller, but the header is not showing up, no matter…
4
votes
2 answers

Rails : How to save the pdf file generated using wicked pdf

I am using WickedPdf respond_to do |format| format.html format.pdf do render :pdf => "file_name" end end This is working fine . the user is able to download the generated pdf . but i need to store the generated pdf in server for other…
Krishna Prasad Varma
  • 4,670
  • 5
  • 29
  • 41
4
votes
1 answer

How can I save a pdf with wicked-pdf and inspect it as an html

I am creating a pdf file and saving it. pdf=WickedPdf.new.pdf_from_string( html, header: {content: html_header}, footer: {content: html_footer}, page_height: '11in', page_width: '8.5in', show_as_html: true ) save_path =…
Petran
  • 7,677
  • 22
  • 65
  • 104