Prawn/QRCode
A simple extension to generate and/or render QRCodes for Prawn PDFs
Prawn/QRCode is a Prawn (>= 1.0.0) extension to simplify rendering of QR Codes*.
(*) QR Code is registered trademark of DENSO WAVE INCORPORATED.
See http://www.denso-wave.com/qrcode/ for more information.
Install
gem install prawn-qrcode
Usage
require 'prawn/qrcode'
qrcode_content = "http://github.com/jabbrwcky/prawn-qrcode"
qrcode = RQRCode::QRCode.new(qrcode_content, level: :h, size: 5)
Prawn::Document::new do
render_qr_code(qrcode)
render_file("qr1.pdf")
end
Prawn::Document::new do
print_qr_code(qrcode_content, extent: 72)
render_file("qr2.pdf")
end
Prawn::Document::new do
render_qr_code(qrcode, dot: 2.8)
render_file("qr3.pdf")
end
For a full list of examples, take a look in the examples
folder.