Questions tagged [wicked-pdf]
Wicked PDF is a PDF generation plugin for Ruby on Rails using wkhtmltopdf to convert HTML to PDF.
566
questions
0
votes
0
answers
21
views
How to get wkhtmltopdf with a Dockerized Rails App with running ruby:3.0.4-alpine for use with Wicked PDF
I'm trying to upgrade a Dockerized Rails app to Ruby 3+ and Rails 7. Due to other project dependencies, I've landed on this version of Ruby Docker image ruby:3.0.4-alpine. Here's my Dockerfile:
FROM ...
0
votes
1
answer
34
views
How get pdf file from httparty get response
I would like render a PDF with wicked_pdf or download it from GET response with httparty,
I succeed to do it with curl -o filename url but i dont know how do it with Rails
1
vote
1
answer
29
views
Use ActiveStorage Image in wicked_pdf
I can't get ActiveStorage images to work in production. I want to use a resized image (variant) within the body of the PDF I'm generating.
= image_tag(@post.image.variant(resize_to_limit: [150, 100]))
...
0
votes
1
answer
31
views
wicked_pdf css background image not showing
I'm using wicked_pdf in Ruby-on-Rails to generate a PDF and I want to set a background image on the body element. I've linked a stylesheet with stylesheet_link_tag wicked_pdf_asset_base64("pdf....
0
votes
0
answers
64
views
Wicked PDF fails on production only, PDF could not be generated!: could not find rake 13.0.6 in any of the sources (Bundler::GemNotFound)
I've been searching all over the internet but couldn't find a working solution.
I have a rails app running on puma and nginx which generates a PDF with no problems on development (Mac OS Monterrey) ...
0
votes
0
answers
12
views
Wicked_pdf keeps on rendering in the backend without showing anything in mail
I have a mailer in which I am trying to generate PDF and then send it as an attachment:
Here's my mailers/invoice_mailer.rb:
def invoice
@invoice = params[:invoice]
recipients = params[:...
1
vote
0
answers
26
views
How to add a link_to phone number with wicked pdf
I would like to insert (in a wicked pdf) a link to a phone number like :
<a href="tel:<%= @user.phone %>"><%= @user.phone %></a>
0
votes
0
answers
15
views
Wicked PDF not show image with Action Controller
The issue I am facing here is that the logo.png is not showing up in the pdf file which gets created.
user_update_service.rb
class UserUpdateService
def initialize(user)
@user = user
end
...
0
votes
1
answer
177
views
Ruby on Rails Wicked PDF Template Missing Error
I am currently using rails 7 with wicked pdf . wicked pdf is throwing me an missing template error even if I have template file at exact place? what am i doing wrong?
def show
respond_to do |...
0
votes
1
answer
49
views
How to add a header to each page in a pdf created by wickedpdf using pdf_from_string
I am working with a full stack rails app, trying to add a header to each page that is "printed". The pdf is generated by creating a string using PdfController.renderer.render and passing it ...
0
votes
1
answer
108
views
wicked_pdf header and footer no rendered
I am using wicked_pdf in my sinatra application. When i try to add a header or footer it is not shown in the pdf. Only the body element is working. Why the header and footer are not applied?
Here the ...
0
votes
1
answer
49
views
WickedPDF generated with ActiveJob is creating a margin - how to fix?
I want to generate a PDF with ActiveJob, and then save it as an attachment to a record.
When I generate the PDF from a controller action, it looks fine:
When I move it to a background job, it is ...
0
votes
0
answers
192
views
RuntimeError for WickedPdf pdf generation in Ruby Production
I am trying to generate pdf in production server.In local host everything works fine for me. No error while I am generating PDF. but in production getting this error.
2.3.1 :001 > WickedPdf.new....
0
votes
0
answers
22
views
Digital signatures in WickedPdf
There is a library to generate electronic signatures for service provision contracts in Ruby on Rails, pdf contracts come out with wickedpdf.
rails 2.0.0
0
votes
1
answer
297
views
Can't add stylesheets to wicked_pdf
I tried adding tailwind css stylesheets to wicked_pdf, but every time I try to open the pdf I get this error:
Webpacker can't find {:media=>"all", :host=>"localhost:3035"}....
0
votes
1
answer
417
views
Wicked pdf, failed to load PDF document
I am trying to implement the gem wicked_pdf . After initial difficulties (fatal error (exception reentered)), I managed to start the server. I set up a pdf with the content "Hello world" for ...
0
votes
0
answers
164
views
Wicked PDF generated a PDF with a lot of white space
I'm trying to generate a PDF from an HTML template with the intention that it will fill out the entire page so users can print them out. However, there's white space in the right and bottom and I'm ...
0
votes
1
answer
210
views
Why my image doesn't load when using wicked_pdf_image_tag?
I'm creating a service to add a watermark to the top of a client pdf file. When I add it to the pdf source, the html text loads fine but not the image (a small square is shown instead).
Here some ...
1
vote
1
answer
117
views
How to create a wicked_pdf document in background
I want to create a pdf document using wicked_pdf. However, all the tutorials are doing so using a 'show' method. I want to do so soon after saving/creating an item. Here is my create method.
def ...
0
votes
0
answers
59
views
Rails 6 and rebuilding cached assets(?)
I have an app that supposed to generate PDFs with a gem called wicked_pdf. When I try to invoke it, I get an error. The logs give a hint of the problem:
ActionView::Template::Error (The asset "qr-...
0
votes
0
answers
62
views
UncaughtThrowError: uncaught throw :app_exception in case of version 2.1.0 of wicked_pdf
I want to use the gem 'wicked_pdf' to generate pdfs from htmls in a Ruby on Rails applicaiton. To install wicked_pdf one has to add the following two gems to the Gemfile:
gem 'wicked_pdf'
gem '...
0
votes
1
answer
133
views
Wicked PDF - images are not showing
I'm using ruby 3.0.0 and rails 6.1.3.2. I've looked into many examples, but haven't found a solution to finally show images inside a PDF. The PDF renders (CSS is also working), but images appear as ...
0
votes
1
answer
133
views
Rails wicked_pdf file name in PDF reader
In ma Rails app I have a route (download.pdf) that returns a PDF
format.pdf do
render pdf: "#{@sale.firstname}#{@sale.lastname}", dpi: 400
end
The PDF is opened in Chrome as download.pdf ...
1
vote
1
answer
210
views
Wicked PDF does not showing webp format images
I'm using this tag but it does not support webp format file it does not show image on pdf for webp format. images for other formats it is working fine
<%= wicked_pdf_image_tag(my_img, height: '300')...
2
votes
1
answer
102
views
Gem Chartkick charts not rendering on PDF
I'm using Rails 5.2.4, Gem Chartkick(3.3.1) and wicked_pdf(1.4.0).
As many people wrote, I can also not display a pie chart on pdf through Chartkick and wicked_pdf, just "loading" is shown.
...
0
votes
1
answer
725
views
PDF Generation with Ruby on Rails 6.0 and Heroku
I am stucked with pdf generation in a Ruby on Rails 6.0 (Ruby v2.7.1) website on HEROKU.
The goal: generate on the run a pdf photo gallery including a list of pictures. The gallery is from an external ...
2
votes
2
answers
466
views
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
...
-1
votes
1
answer
395
views
Wkhtmltopdf libpng15.so error with Rails 6.1
I have recently upgraded my Rails application from 6.0 to 6.1 and after upgrading whenever I am trying to generate a PDF, I get this error:
RuntimeError: Failed to execute: ["/opt/rubies/ruby-2.6....
0
votes
1
answer
46
views
Display images with WickedPDF on an RoR App
I actually generate PDF with WickedPDF on my app. And now I just want to include an image "logo.jpg" on the header of my PDF.
I tried lot of things, and I think my problem come from assets.
...
0
votes
1
answer
42
views
Application Layout Stylesheet Include Can't Find Image Asset Using Wicked PDF Using Bootstrap
My Rails 6 app is using webpack and yarn. I still use the asset pipeline for my sass stylesheets. I'm using a layout css stylsheet for my PDFs that I generate with Wicked PDF. I get the following ...
2
votes
0
answers
177
views
Rails wicked_pdf & chartkick not working - showing loading
I'm trying to make chartkick work with wicked_pdf but all it does is show a loading sign:
I'm using wicked_pdf version: 2.1.0,
wkhtmltopdf-binary version:0.12.6.5
I've tried replacing it with ...
1
vote
0
answers
125
views
Start page numbering after Table of Contents in wicked_pdf
I am generating a pdf from html using wicked_pdf in a RoR app.
The wicked_pdf documentation shows how to number all pages, but
I want to start numbering pages from the page after the Table of ...
2
votes
0
answers
170
views
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 ...
0
votes
1
answer
159
views
WickedPDF image not showing up in production on heroku
I know there are several questions similar to this on stack overflow, but none seem to answer my question. The wkhtmltopdf tool apparently doesn’t know about the rails asset pipeline, and wickedPDF ...
0
votes
1
answer
246
views
WickedPDF generating blank pdfs when attempting to render multiple pdfs
I am using WickedPDF in a Rails 6 project to generate PDFs from HTML, and then combine them with prefilled PDF forms. The WickedPDF generated PDFs are split into two sections, each of which must be ...
4
votes
0
answers
240
views
How to generate a pdf to save it in activestorage with wicked_pdf in rails 5?
With rails 5.2.4, I am trying to generate a pdf in the background (within a job) and then attach it to a model as:
pdf_contents = ApplicationController.render(
pdf: "name",
template: '...
0
votes
1
answer
435
views
Wicked pdf not showing images in action mailer
I want to show a header image in the attached pdf. I'm using the wicked_pdf_asset_pack_path as follows:
estimation_pdf.html.erb
<%= image_tag(wicked_pdf_asset_pack_path("media/images/...
0
votes
2
answers
133
views
wicked_pdf in ruby on rails sidekiq worker: how to make the template used dynamic
I have a sidekiq worker with a private method inside it that uses wicked_pdf to change an HTML file into a pdf then upload it to AWS s3 and return the URL, here's my private method inside the sidekiq ...
1
vote
1
answer
167
views
Extending view to generate PDF returns error after upgrade to Rails 6.1
Until recently I extended the Rails view to generate a PDF in a service object:
view = ActionView::Base.new(ActionController::Base.view_paths, {})
view.extend(ApplicationHelper)
view.extend(Rails....
0
votes
0
answers
134
views
Rails - Creating pdf which contains graphs which are visible to logged in user only
I need to create a pdf using Rails with the following scenario:
My website displays graphs (pie chart and bar graph) for logged in users. I need to add these graphs into the pdf file which will ...
0
votes
1
answer
70
views
When i used wicked_pdf gem it is redirecting to a view page instead of download option
I want to implement file export to pdf in rails. but instead of the download option its redirecting to a view page http://localhost:3000/xmls?pdf=xml.pdf&template=xmls_controller%2Findex.html.erb
...
0
votes
0
answers
98
views
Images 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 I have a body with images in it.
<%= @product_info.body %>
This body contains images and they are ...
1
vote
1
answer
161
views
CSS not getting applied in wicked_pdf for rails 5
The pdf is generated without any CSS to it.
I have used the following code :
In gemfile
gem 'wicked_pdf', '~> 2.1'
gem 'wkhtmltopdf-binary'
in controllers/product_controller - show action
...
0
votes
1
answer
165
views
How to add multiple spaces between two strings in ruby .rb file method for pdf generation?
I want to have more spaces between two strings in my rails pdf file.I tried adding more spaces like " " but it is assuming to have a single space.And also, I am not able to use "\n&...
1
vote
2
answers
2k
views
Command Error: /usr/bin/env: 'ruby2.6': No such file or directory
I ran into a problem on our production server, we have a Rails app that generates a PDF using the gem wicked_pdf and it's throwing the following error:
Failed to execute:
["/var/www/myapp/vendor/...
0
votes
0
answers
40
views
How to make pdf continuous in wicked_pdf
I want to have no page break in wicked_pdf. How can I achieve that?
I tried using
div.no-page-break{
page-break-before: avoid !important;
}
But it didn't work.
Is there a way I can make the pdf ...
2
votes
0
answers
121
views
Missing several characters for Urdu and Sindhi languages
I'm trying to generate pdf with wicked-pdf gem. Pdf is generated through Qt WebKit rendering engine, so I had to install fonts on the server-side for non-utf languages like Myanmar, Urdu, Pashto etc. ...
0
votes
0
answers
282
views
rails wicked_pdf not executing javascript
I am having issues getting javascript to execute in my wicked_pdf template. I have a large template with styling and some charts in which everything but the charts (that was the only javascript on ...
1
vote
0
answers
536
views
Using WickedPDF with Webpacker & Bulma CSS
I'm trying to use WickedPDF in a Rails 6 project that uses the Bulma CSS framework. However, I cannot get it to work properly and I'm wondering what I am doing wrong.
I have a pdf.html.slim layout ...
1
vote
1
answer
788
views
Rails API / react / axios downloads corrupted file
First I created a pdf with WickedPDF.
pdf_string = WickedPdf.new.pdf_from_string(
ActionController::Base.new.render_to_string(template: 'v1/invoices/invoice_template', filename: 'test.pdf')
)
...