QR Codes
Please note that the QR code generator is a separate feature that should be purchased additionally. Contact your imperia sales person for further information.
Invocation#
To use QR codes within a template you need the following instruction:
<?imperia qrcode
option: value
option: value
?>
Example configurations:
<?imperia qrcode
messagemetakey: some_doc_meta_key
scale: 2
margin: 4
level: L
type: png
filename: "Images/qrcode.png"
inline: 1
?>
Or:
<?imperia qrcode
message: "Simple "html" encoded message"
scale: 3
margin: 5
level: Q
preview: 1
color: #4599AA
radius: 1
?>
Configuration Options#
message#
The message option is used to enter the data or text to be encoded as QR code. The message can be plain text or HTML encoded. This option is mandatory and cannot be left empty.
Note
New lines must be HTML escaped.
messagemetakey#
The messagemetakey is an alternative to the message option. In this case, the data that has to be encoded is taken from the specified document meta field.
Important
The messagemetakey and message options cannot be used together. If messagemetakey is specified, it has higher priority and it is used instead of message.
inline#
The inline option generates QR code and prints the result image as Base64 encoded string.
Note
The inline option cannot be used together with the preview option.
preview#
The preview option generates an HTML image tag with Base64 encoded source. The output format of that image is always .png
.
Note
The preview option cannot be used together with the inline option.
color#
The color option is used to specify the color of the generated QR code. The value should be hexadecimal color code (e.g. #00FF00).
radius#
imperia provides the option to use Oil Paint filter for generated QR codes. This filter makes the QR code look more artistic. The radius option specifies the rounding radius of the filter. Possible values are in the range of 0
(default) to 2
.
Tip
Higher values for the radius option may distort the QR code and make in unreadable for QR scanners. Because of this, it is recommended to use lower values and higher error correction levels.
scale#
The scale option is used to specify the scale of the generated QR code. The values can range between 1
and 255
.
margin#
The margin option is used to specify the margin of the generated QR code. The values can range between 0
and 255
.
level#
The level option is used to specify the error correction precision. The accepted values are L
, M
, Q
and H
(lower to higher precision).
type#
The type option is used to specify the QR code image export format. The supported formats are:
-
png
-
jpeg
-
ASCII
filename#
The filename option contains a relative path to DOCUMENT_ROOT, where the QR code will be stored.
Note
The file is saved on the file system and is not part of the MAM.