Notes to self

InvoicePrinter 2.5 with QR images and Ruby 3.4 support

Today I released a new version of InvoicePrinter, my Ruby library for generating PDF invoices. Here’s what’s new.

New features

I finally implemented last feature I had in mind, QR code images. I decided not to add dependencies and keep it as a simple image, although we could consider a built-in feature later on.

To add a QR code, simply point to your QR image path:

invoice = InvoicePrinter::Document.new(
  number: 'NO. 202500000001',
  provider_name: 'John White',
  provider_lines: provider_address,
  purchaser_name: 'Will Black',
  purchaser_lines: purchaser_address,
  issue_date: '10/20/2025',
  due_date: '11/03/2025',
  total: '$ 900',
  bank_account_number: '156546546465',
  description: "Invoice with QR image example.",
  items: [],
  note: "Scan the QR code for payment or details."
)

qr_path = File.expand_path('../qr.png', __FILE__)

InvoicePrinter.print(
  document: invoice,
  qr: qr_path,
  file_name: 'qr_invoice.pdf'
)

The QR code will always appear bottom right, above any notes if they exist.

Ruby support

InvoicePrinter got Ruby 3.4 support. It currently supports Rubies from 3.1 to 3.4. We are staying with current Prawn version due to a circular dependency.

New contributors

Simon Neutert was a new contributor in this release, thanks Simon!

Check out my book
Deployment from Scratch is unique Linux book about web application deployment. Learn how deployment works from the first principles rather than YAML files of a specific tool.
by Josef Strzibny
RSS