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