QR code generator


This plugin lets you generate QR codes in your wiki apps. You simply feed it a string and it will render the QR image for it.

You type:

%QRCODE{"hello world"}%

You get: (if installed)

Error: (3) can't find hello-world.png in System

There are favious use cases for QR codes. Most notably, QR codes might be used to label physical objects by sticking a QR code on them. These may then be scanned in with a mobile device or any other QR code scanner to connect the physical object to with a virtual information about it.

QR codes are also used for two-factor authentication to enhance security of a sign in process. Foswiki does provide a two-factor authentication with an additional plugin TwoFactorAuthPlugin.

Note that this plugin generates QR codes on the server side. There is another plugin to generate them on the client side (i.e. on your browser) called JQRCodeContrib. Generating them using a JavaScript plugin does have some advantages over codes generated on the server by adding extra flexibility in the way information can be processed. Onn the other side using QRCodePlugin to generate them on the server side has got the big advantage that these may be printed out or stored in PDF documents without any hassle.


%QRCODE{"<string>" ...params.."}%

Parameter Description Default
"..." or text="..." string to be encoded; this may also contain standard format tokens ($percnt, $dollar etc) in which case the string is processed as a wiki application the result of which is then encoded  
class="..." css class added to the <img ...> element being inserted into the html page qrCode
format="..." format string of the result; this should be some kind of= <img ..>= tag with variables $uri expanding to the inline image data and $class to expand to the css classes <img src="$uri=" class="$class" />
size="..." square size of the image 147
level="1/2/3/4/5" level of error correction 1
scale="1/2/.../100" scale of the image 3
quiet="<number>" margin of quiet whitespace around the QR code being generated 0

REST handler

In addition to generating QR codes using the %QRCODE makro these may also be generated using a REST handler:

<img src="%SCRIPTURLPATH{"rest"}%/QRCodePlugin/encode?...<url-params>...

The <url-params basically are the same parameters available to the %QRCODE macro, except they need to be url encoded.

Installation Instructions

You do not need to install anything in the browser to use this extension. The following instructions are for the administrator who installs the extension on the server.

Open configure, and open the "Extensions" section. "Extensions Operation and Maintenance" Tab -> "Install, Update or Remove extensions" Tab. Click the "Search for Extensions" button. Enter part of the extension name or description and press search. Select the desired extension(s) and click install. If an extension is already installed, it will not show up in the search results.

You can also install from the shell by running the extension installer as the web server user: (Be sure to run as the webserver user, not as root!)
cd /path/to/foswiki
perl tools/extension_installer <NameOfExtension> install

If you have any problems, or if the extension isn't available in configure, then you can still install manually from the command-line. See https://foswiki.org/Support/ManuallyInstallingExtensions for more help.



Change History

05 May 2022 minor docu fixes
17 Dec 2018 initial release

PackageForm edit

Author Michael Daum
Version 1.01
Release 05 May 2022
Description QR code generator
Repository https://github.com/foswiki/QRCodePlugin
Copyright 2018-2022 Michael Daum
License GPL (GNU General Public License)
Home https://foswiki.org/Extensions/QRCodePlugin
Support https://foswiki.org/Support/QRCodePlugin
Topic attachments
I Attachment Action Size Date Who Comment
hello-world.pngpng hello-world.png manage 224 bytes 17 Dec 2018 - 09:39 ProjectContributor  
Topic revision: r1 - 17 Dec 2018, ProjectContributor
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback