SwissQrBill.Output.PngOutput (swiss_qr_bill v0.1.2)

Copy Markdown View Source

Generates PNG output by rasterizing the PDF via pdftocairo. The PDF is the source of truth — PNG is a pixel-perfect rasterization.

Requires pdftocairo (from poppler-utils) to be installed.

  • macOS: brew install poppler
  • Ubuntu/Debian: apt install poppler-utils

Summary

Functions

Generates the payment part as a PNG binary. Uses PdfOutput as source and rasterizes via pdftocairo.

Functions

render(bill, opts \\ [])

@spec render(
  map(),
  keyword()
) :: {:ok, binary()} | {:error, String.t()}

Generates the payment part as a PNG binary. Uses PdfOutput as source and rasterizes via pdftocairo.

Options

  • :language:de, :fr, :it, :en, or :rm (default: :de)
  • :dpi — resolution in DPI (default: 300)