Over a million developers have joined DZone.

Create A QR Code

DZone's Guide to

Create A QR Code

Free Resource
Create a QR code.

require 'rubygems'
require 'rqrcode'
require 'qr_image'

# QR Code parameters
text = 'This is a test'
size = 4
level = 'h'
# Produce the QR Code
qr = RQRCode::QRCode.new(text,  :size => size, :level => level)
# Create the image and double its size
img = QRImage.new(qr).sample(6)
# Write image to disk
img.write('./qr.png') { quality = 100 }

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}