Sha256: 62cac63d1a7acfe0e081fb05495e828cb8076fb6710e78e9847fb1f21b2c6c84
Contents?: true
Size: 588 Bytes
Versions: 10
Compression:
Stored size: 588 Bytes
Contents
module BrDanfe module DanfeLib module NfceLib class QrCode require 'rqrcode' require 'chunky_png' require 'tempfile' def initialize(pdf, xml) @pdf = pdf @xml = xml end def render qrcode = RQRCode::QRCode.new(@xml['qrCode']) image = Tempfile.new(%w[qrcode png], binmode: true) image.write(qrcode.as_png(module_px_size: 12).to_s) box_size = 3.cm @pdf.image image, width: box_size, height: box_size, position: :center end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems