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
3
votes
0 answers

Generate PDF file from image/docx/xlsx/csv file and store into s3 rails 6.0

I am working on rails 6 application in API only mode. So there is no view for this. I am storing the uploaded files on the s3 now I want to generate the pdf of the uploaded file. For that, I am using the s3 url of the uploaded file and tried to…
urjit on rails
  • 1,763
  • 4
  • 19
  • 36
3
votes
0 answers

Save PDF with Active Storage and wicked_pdf gem

I need to save a PDF using wicked_pdf gem and Active Storage, unfortunately I haven't achieved it. It is a very simple scenario, I need to create the PDF and save the object in the same process. The PDF is generated from a view. @user =…
Gerardo S
  • 187
  • 11
3
votes
1 answer

WickedPdf Not Displaying Remote Images from S3 in Production

First of all, everything works just fine in my dev environment and worked fine in production until I updated my Rails app to Rails 5.2.2 and Ruby to 2.5.3 (both were only a couple of minor versions off). I updated a number of other gems but neither…
Cannon Moyer
  • 3,014
  • 3
  • 31
  • 75
3
votes
1 answer

Rails Wicked PDF error log (image not rendering)

I am using Rails 5 and Wicked PDF to render a PDF. On my localhost everything works fine but on my Heroku production server the image is not being rendered. First guess of course is that the image is only available on localhost but that's not the…
almo
  • 6,107
  • 6
  • 43
  • 86
3
votes
1 answer

Wicked_PDF not rendering bootstrap 4 styles

Following my previous wicked_pdf question, now that I am rendering the correct template I cannot get the pdf to render the bootstrap styling of the application. I am using bootstrap 4, ruby '2.4.2' and gem 'rails', '~>…
3
votes
3 answers

Wicked_pdf Table of Contents text size very small

I am trying to generate PDF using WIckedPdf version = 1.1.0 wkhtmltopdf 0.12.4 (with patched qt) Rails 4.2 Below is my Controller endpoint @cover = render_to_string layout: "application.html.erb", template: "pdf/cover.html.erb", locals: {report:…
3
votes
0 answers

Wicked_PDF kills the server memory when too many images in Rails

I am using wicked_pdf to generate a pdf report in a rails 5 project. But the server gets down when there are too many images on the report. All the images are saved in the same server. And I use external css files which are located in the same…
Charith H
  • 345
  • 1
  • 13
3
votes
0 answers

Generating a PDF using Wicked PDF with Google Charts and JvectorMap not rendering Maps and Charts in the PDF

I'm using Wicked PDF to generate a report which shows a Map generated by jvectormap and a Bar Chart that is generated with Google Charts. I'm using this two gems 'wicked_pdf' and 'wkhtmltopdf-binary-edge'. I have set a JavaScript delay on the…
3
votes
1 answer

Upload Wicked generated PDF to AWS S3 in Rails 5

I am generating invoices as PDFs and want to upload them directly to S3. I am using Wicked-PDF and the official AWS SDK. gem 'wicked_pdf' gem 'aws-sdk-s3', '~> 1' Now I create the PDF: pdf = render_to_string pdf: "some_file_name", template:…
almo
  • 6,107
  • 6
  • 43
  • 86
3
votes
2 answers

wicked pdf doesnt find my assets in production

I have a problem with my CSS of wicked pdf Everything work in local but it not find the pdf.css in production ActionView::Template::Error (The asset "components/pdf.css" is not present in the asset pipeline.):
Antoine Wako
  • 145
  • 1
  • 17
3
votes
1 answer

how use html view/partial to pdf view with wicked_pdf gem?

def foo respond_to do |format| format.html { render layout: 'application' } format.pdf { render pdf: 'foo', layout: 'pdf' } end end if I put only hello world in foo.pdf.erb it works ! but now if I want use a html view to…
Matrix
  • 3,458
  • 6
  • 40
  • 76
3
votes
2 answers

High CPU Usage when generating PDFs in Rails with Wicked_PDF gem

I'm trying to generate a PDF file with Rails, but when I do I notice my system CPU starts to max out. Initially, it will go from ~2.5% then increase to ~65%-$80% for a steady period of time and then finally max out almost prior to displaying them…
daveomcd
  • 6,367
  • 14
  • 83
  • 137
3
votes
1 answer

Wicked PDF: How to remove top margin from COVER page?

I'm generating pdf's from html using wicked_pdf. Right now, I want to remove top margin on the first/cover page . This is a snipped code from my controller : render :pdf => @project.name, :javascript_delay => 1000, :disable_external_links =>…
abhsss96
  • 353
  • 2
  • 11
3
votes
1 answer

charts are not being show with wicked_pdf

I'm using chart.js in my rails project with activeadmin I have this in my action controller do before_action :set_query, only: :index def index respond_to do |format| format.html format.pdf do render pdf: "file_name",…
Asnad Atta
  • 3,855
  • 1
  • 32
  • 49
3
votes
1 answer

Rails Production: Bundle is locked to rake

I've just added an export to PDF using the wicked_pdf gem to my application. It works fine on my development machine, but it keeps throwing the following error on the production server: I, [2016-12-01T03:40:46.110058 #2857] INFO -- : Rendered…