Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Ruby QRCode generator
Branch: master

Ignore files

latest commit 5808011ff7
Bojan Milosavljevic authored
Failed to load latest commit information.
lib Renaming directories
test Fixes in gemspec files
.hgignore Ignore files
Gemfile Fixes in gemspec files
History first commit
MIT-LICENSE first commit Small changes in file
Rakefile Fixes in gemspec files
qrcoder.gemspec Renaming directories

Creates QR codes images

This library is fork of Sam Vincent rqrcode-rails3 Dependes on mini_magic and rqrcode

This gem supports generating QR images in SVG, BMP, TIF, JPG, GIF and PNG format.


Add the following to your +Gemfile+.

gem 'qrcoder'


gem install qrcoder

How to use

Image method

If you use image method you must define output format.

Allowed formats are

  • png
  • bmp
  • svg
  • jpg
  • gif
  • tif

    QRCode.image(text, output, options)


QRCode.image("some text", "/home/user/", :format => [:png, :svg], :filename => "simple_test" 
QRCode.image("some text", "/home/user/", :format => :png, :filename => "simple_test" , :unit => 12

SVG output

Return svg output

QRCode.svg(text, output, options)


QRCode.svg("some text", "/home/user", :filename => "simple_test", :unit => 12) 

Other methods

You can use other methods

QRCode.bmp(text, output, options)
QRCode.png(text, output, options)
QRCode.jpg(text, output, options)
QRCode.tif(text, output, options)
QRCode.gif(text, output, options)


  • :size – This controls how big the QR Code will be. The smallest size will be chosen by default. Set to maintain consistent size.
  • :level – The error correction level, can be:
    • Level :l 7% of code can be restored
    • Level :m 15% of code can be restored
    • Level :q 25% of code can be restored
    • Level :h 30% of code can be restored (default :h)
  • :offset – Padding around the QR Code (e.g. 10)
  • :unit – How many pixels per module (e.g. 11)
  • :fill – Background color (e.g "ffffff" or :white)
  • :color – Foreground color for the code (e.g. "000000" or :black)


This library is fork of Sam Vincent rqrcode-rails3

QR codes are encoded by rqrcode

Something went wrong with that request. Please try again.