Ask A Question

Notifications

You’re not receiving notifications from this thread.

How to insert QRCode into PDF using receipts gem?

czepesch asked in Rails

Hi!
I'm using receipts gem to generate pdf. Also I want to insert QRcode for the payment (for example into footer section).
Tell me please, is there any examples of doing so?
I want QRcode to consist of Partner attributes, like iban, money amount, etc. Like: charge.partner.iban

I trying to put qrcode = RQRCode::QRCode.new(self.partner.ico.to_s) and this png = qrcode.as_png to receipt method in Charge model
and somehow use it in the footer: footer: ActionController::Base.helpers.image_tag(png.to_data_url)
Maximum all I get is image in the form of the string

Reply

I got help on stackoverflow, but I can't post the link.

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 82,329+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

    © 2024 GoRails, LLC. All rights reserved.