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

wicked_pdf renders a tiny pdf image

I have added wicked_pdf to my rails app with default options following the readme file (with the deviation being that I installed wkhtmltopdf via the osx installer). When I render my page with the .pdf?debug=true option, the page looks exactly as it…
ErwinM
  • 5,051
  • 2
  • 23
  • 35
4
votes
3 answers

wickedpdf not rendering images?

i am using wickedpdf gem to generate pdf invoice from the html code. gems: gem 'wicked_pdf' gem "wkhtmltopdf-binary" gemfile.lock wicked_pdf (1.0.6) wkhtmltopdf-binary (0.9.9.3) in controller: def show_pdf_invoice respond_to do |format| …
John
  • 1,273
  • 3
  • 27
  • 61
4
votes
1 answer

Gem wicked pdf - CSS doesn't work with rails 5

I just upgrade my application to rails 5 and the gem wicked pdf doesn't display css anymore. I changed nothing, so there're may be some specifications with rails 5. If anybody figure out this problem feel free to help :) Here is my code…
Orsay
  • 1,080
  • 2
  • 12
  • 32
4
votes
0 answers

Wicked PDF: Dynamic height for Entire Document

I'm using Wicked_PDF GEM. Is it possible to set the document height to "AUTO" or something, So that it would change according to the count of created line items inside an order ? And If not could you guide me to another tool or GEM to help me do…
Moataz Zaitoun
  • 729
  • 1
  • 7
  • 18
4
votes
0 answers

Wicked_pdf: Rspec fails for wicked_pdf_stylesheet_link_tag

I'm using Rails 4.3 and generating pdf with wicked_pdf gem in a mailer. The main code for creating the pdf in the mailer is this: temporary_local_file = Rails.root.join('tmp', name) pdf = WickedPdf.new.pdf_from_string(render_to_string template: …
4
votes
4 answers

Wicked PDF unable to handle page break

I'm using gem wiked_pdf in my Rails application that generates report. But I'm having trouble fixing the breaking of data when having more that 1 page. Please see image. I tried many time to adjust the margin or spacing, but still unable to fix…
aldrien.h
  • 3,437
  • 2
  • 30
  • 52
4
votes
2 answers

Images not rendered with secure connection to Amazon S3

I am creating a PDF which contains images which are stored on Amazon S3. My Rails application uses https, so also the URL to the S3 image is https, which is configured in production.rb: config.paperclip_defaults = { :storage => :s3, :s3_protocol…
John
  • 6,404
  • 14
  • 54
  • 106
4
votes
1 answer

rails 4 wicked pdf missing template

I have used wicked pdf gem for html to pdf generate in rails 4.It doesn't work for me and It throw error like this ActionView::MissingTemplate at /events/calendar_month_print.pdf Missing template events/calendar_month_print.html.erb with…
Karthick
  • 433
  • 1
  • 10
  • 25
4
votes
0 answers

PDF Print view not the same between development and production environments using wkhtmltopdf/wicked_pdf

I am using wkhtmltopdf/wicked_pdf to generate a PDF view in Rails on Heroku. I am running Mac OS X locally. Here are my versions: - Ruby 2.1.3 (Both) - Rails 4.0.3 (Both) - wkhtmltopdf-binary-edge, 0.12.2.1 (Local) - wkhtmltopdf-amd64, 0.12.2.1…
4
votes
4 answers

Render PDF in Browser (instead of download default)

I store PDF receipts in S3. I use WickedPDF for generating the PDF files. Via the admin area of our app, there is a "Download" link, that is simply a direct link to the S3 path: link_to "Download", order.receipt.url unless order.receipt.blank? Any…
Ryan Rebo
  • 1,278
  • 2
  • 13
  • 27
4
votes
1 answer

Rails generate PDF from html

I'm facing some problems to generate PDF from html with Rails. I tried to use PDFKit and Wicked_PDF gems, with both I had a problem with page break, they break inside a . Let me show you what I'm doing with Wicked_PDF: In my controller: render…
4
votes
1 answer

Wicked PDF silently fails on OS X

With the same code and gem versions, it works just fine in Ubuntu (14.04, 64bit). Currently I am using: wkhtmltopdf-binary gem v0.9.9.1 wicked_pdf gem v0.10.2 Rails 4.1.1 Ruby 2.1.3 OS X 10.10, 64-bit When I tried to generate PDF from Rails, i get…
dvdchr
  • 734
  • 11
  • 26
4
votes
5 answers

ChartKick charts do not show when rendering to PDF using Wicked_PDF

I am using Rails 4, Wicked_PDF and Chartkick Gem's For Google Charts I use: <%= javascript_include_tag "//www.google.com/jsapi", "chartkik" %> The html view comes up with charts and everything as expected. When I append .pdf to the url the pdf…
user3334207
  • 155
  • 1
  • 10
4
votes
0 answers

generating pdf files with sidekiq worker

I'm trying to generate a pdf file from inside a sidekiq worker. Although I am making a new instance of ActionView and including AppHelper and Routes, I still don't have any styles inside the pdf (no layout is considered). Here's the…
Bogdan Popa
  • 1,099
  • 1
  • 16
  • 37
4
votes
1 answer

wicked_pdf not importing twitter bootstrap styles

I am rendering a pdf file through wicked_pdf gem: format.pdf do render :pdf => 'oferta', :template => 'templates/show_offer.pdf.erb', :layout => "layouts/templates.html.erb", :print_media_type => true, :page_size => "A4", …
Bogdan Popa
  • 1,099
  • 1
  • 16
  • 37