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

warning: already initialized constant PDF

Right now I am working on rails 3.0.0. If I run my project in terminal, I get this warning. Please help me. /usr/share/ruby-rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.0.0/lib/action_dispatch/http/mime_type.rb:98: warning: already initialized…
chandrashekar
  • 609
  • 2
  • 7
  • 16
22
votes
4 answers

Rails 3 ActionMailer and Wicked_PDF

I'm trying to generate emails with rendered PDF attachements using ActionMailer and wicked_pdf. On my site, I'm using already both wicked_pdf and actionmailer separately. I can use wicked_pdf to serve up a pdf in the web app, and can use…
Daniel D
  • 3,637
  • 5
  • 36
  • 41
20
votes
2 answers

Rails 3 -Render PDF from view and attach to email

I have been using Wicked_pdf to render a view as a PDF and actionmailer to send emails, but I can't get them to work together. I want to attach a PDF version of a certain view to an email using actionmailer and send it out by clicking a link or a…
19
votes
2 answers

Wicked_PDF templates is missing

I installed wicked PDF and modified my controller : def show respond_to do |format| format.pdf do render :pdf => "file_name" end format.html end end Here is how i link to the pdf : compte_contrat_path(c,:format=>'pdf') It…
Syl
  • 3,719
  • 6
  • 35
  • 59
17
votes
4 answers

problem implementing wicked pdf on heroku

I am using this guide for integrating wicked_pdf on heroku. But somehow it doesn't seem to work. I got the logs from heroku and its says this: Processing PdfController#get_pdf to pdf (for 115.248.175.50 at 2011-02-15 23:54:44) [GET] Parameters:…
17
votes
2 answers

Getting PDF from WickedPDF for attachment via Carrierwave

In Rails3, I am using the WickedPDF gem to render a PDF format of one of my models. This is working fine: /invoices/123 returns HTML, /invoices/123.pdf downloads a PDF. In my Invoice model, I am using the state_machine gem to keep track of Invoice…
lascarides
  • 335
  • 3
  • 9
15
votes
1 answer

Wicked_pdf avoid page-break-inside not working

This is the result when i use Wicked_pdf to convert my html.erb page to pdf. Problem: Seem table 's tr has been splitted into two pages. What i tried without success: Use page-break-inside as described here or here table, tr, td, th, tbody,…
Nhat Dinh
  • 3,378
  • 4
  • 35
  • 51
14
votes
3 answers

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

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"…
Syl
  • 3,719
  • 6
  • 35
  • 59
13
votes
8 answers

wicked_pdf Error: PDF could not be generated

Gemfile gem "wicked_pdf" gem "wkhtmltopdf-binary" the error: RuntimeError in CarsController#show Failed to execute: /usr/bin/wkhtmltopdf --print-media-type -q - - Error: PDF could not be generated! Rails.root:…
rmagnum2002
  • 11,341
  • 8
  • 49
  • 86
13
votes
4 answers

Wicked-PDF not showing images, 'wicked_pdf_image_tag' undefined

I want to generate a PDF with our department logo in it. When I try to use the WickedPdf class in my controller (using the method described at https://github.com/mileszs/wicked_pdf): def some_action image_tag_string = image_tag('logo.jpg') pdf =…
NewbieOnRails
  • 175
  • 1
  • 1
  • 8
12
votes
1 answer

wicked_pdf shows unknown character on unicode pdf conversion (ruby)

I'm trying to create a pdf from a html page using wicked_pdf (version 1.1) and wkhtmltopdf-binary gems. My html page contains a calendar emoji that displays well in the browser whatever font I use
rico1892
  • 123
  • 1
  • 6
12
votes
2 answers

`undefined method `find_asset' for nil:NilClass`

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…
RockStar
  • 1,304
  • 2
  • 13
  • 35
12
votes
2 answers

Base64 @font-face Font with wicked_pdf Generator

I am trying to use a specific font in an HTML to PDF generated PDF file using wicked_pdf on a Rails 3 site. I have found other advice on here which I followed. The only thing that (mostly) worked for me was converting the fonts to base64. I found…
weyakin
  • 121
  • 1
  • 3
11
votes
6 answers

Rails: wkhtmltopdf RuntimeError (Location of wkhtmltopdf unknown)

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…
dbaruah
  • 113
  • 1
  • 1
  • 4
11
votes
4 answers

RuntimeError (Failed to execute: Error: "\xFE" from ASCII-8BIT to UTF-8):

Trying to use Wicked PDF. I have this code in the controller def pdf pdf = WickedPdf.new.pdf_from_string( render_to_string( pdf: 'filename.pdf', template: '/pages/poa.html.slim', layout: '/layouts/pdf'), header: { content:…
RodM
  • 426
  • 1
  • 5
  • 19
1
2 3
38 39