RQRCodeSVG

Combined with RQRCode, this gem allows you to generate QR codes as SVG documents.

The structure of this gem is based heavily on rqrcode_png. Thanks @DCarper!

Installation

$ gem install rqrcode_svg

Usage

This gem adds a method called #to_svg to RQRCode's QRCode class:

qr_code = RQRCode::QRCode.new('http://example.com')
svg = qr_code.to_svg # => returns an instance of RQRCodeSVG::Image

When you want your document, just call render, and pass in your size.

svg.render(100)

This will return a string containing an entire SVG document consisting of <rect>s. The final result looks like this:

http://example.com

Contributing

  1. Fork it
  2. Send a pull request

License

MIT License