def print_qr_code(content, level: :m, dot: DEFAULT_DOTSIZE, pos: [0,cursor], stroke: true, margin: 4, **options)
      qr_version = 0
      dot_size = dot

      begin
        qr_version += 1
        qr_code = RQRCode::QRCode.new(content, size: qr_version, level: level)
        dot = options[:extent] / (2*margin + qr_code.modules.length) if options[:extent]

        render_qr_code(qr_code, dot: dot, pos: pos, stroke: stroke, margin: margin, **options)
      rescue RQRCode::QRCodeRunTimeError
        if qr_version < 40
          retry
        else
          raise
          end
      end
    end
def print_qr_code(content, level: :m, dot: DEFAULT_DOTSIZE, pos: [0,cursor], stroke: true, margin: 4, **options)
      qr_version = 0
      dot_size = dot

      begin
        qr_version += 1
        qr_code = RQRCode::QRCode.new(content, size: qr_version, level: level)
        dot = options[:extent] / (2*margin + qr_code.modules.length) if options[:extent]

        render_qr_code(qr_code, dot: dot, pos: pos, stroke: stroke, margin: margin, **options)
      rescue RQRCode::QRCodeRunTimeError
        if qr_version < 40
          retry
        else
          raise
          end
      end
    end
Prints a QR Code to the PDF document. The QR Code creation happens on the fly.

 content::  The string to render as content of the QR Code

 *options:: Named optional parameters

   +:level+:: Error correction level to use. One of: (:l,:m,:h,:q), Defaults to :m
   +:extent+:: Size of QR Code given in pt (1 pt == 1/72 in)
   +:pos+:: Two-element array containing the position at which the QR-Code should be rendered. Defaults to [0,cursor]
   +:dot+:: Size of QR Code module/dot. Calculated from extent or defaulting to 1pt
   +:stroke+:: boolean value whether to draw bounds around the QR Code.
             Defaults to true.
   +:margin+:: Size of margin around code in QR-Code modules/dots, Default to 4
   +:align+:: Optional alignment within the current bounding box. Valid values are :left, :right, and :center. If set
             This option overrides the horizontal positioning specified in :pos. Defaults to nil.
   +:debug+:: Optional boolean, renders a coordinate grid around the QRCode if true (uses Prawn#stroke_axis)