Project

qrcoder

0.0
No commit activity in last 3 years
No release in over 3 years
Creates QR code files in png, bmp, png, jpg, tif and svg file format. This is fork of sam vincent rqrcode-rails3
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.0.0
>= 0

Runtime

>= 0.4.2
 Project Readme

Creates QR codes images

This library is fork of Sam Vincent rqrcode-rails3 https://github.com/samvincent/rqrcode-rails3 Dependes on mini_magic and rqrcode

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

Installation

Add the following to your +Gemfile+.

gem 'qrcoder'

or

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)

Examples

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)

Example

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)

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)

About

This library is fork of Sam Vincent rqrcode-rails3

QR codes are encoded by rqrcode