The QR Code plugin allows you to generate QR Codes for your pages.

Although you can display the QR Code directly on your pages, in most cases you just use it to get the code and use it on another website or to add do a document you want to print.

It is very easy to create a QR Code for any page on your website using the /qrcode path and adding the path to the page you want a QR Code for. You can also use attributes to define the size and various other parameters.

For example, say you have a blog page under "/blog/20160307/QR-Codes-Are-Cool". To get the QR Code image for that page, you would use the following page:


The path of a QR Code image is dynamic and you cannot generate a QR code for them (since it would otherwise create an infinite number of pages which is not a good feature on any website.)

Because there is a limit to the length of a URI that a QR Code can accept, if longer, the system automatically switches to the Short URL (See shorturl plugin) whether or not the plugin was setup to use such. If not available and the URI is too long, the plugin is expected to generate an error since it won't be able to calculate the QR Code in full. Note that you should not worry to much about this since the limit is 2,900 characters.

The size of the QR Code can be forced with the scale parameter. The scale can be any number from 1 to 5. To generate a really large image, use 5 as in:


The QR Code can be rendered with an edge of 1 to 50 pixels. The default is 5. You can change the default in the QR Code plugin settings. Note that the edge size does not vary depending on the scale. The parameter is named edge and can be used as follow:


The resulting image can of course be included in your page using an image tag:

<img src="..."/>

Snap! Websites
An Open Source CMS System in C++

Contact Us Directly