Apply inline CSS to the HTML table and each data cell element using the options above. Setting this to false removes the width, height, color, and background options, forcing you to recreate them outside the QR code with a style sheet. Given the file size constraints of email, false is recommended.
SVG-only Options
Name
Default
Required
Description
padding
0
No
The amount of white space around the image, in modules
join
false
No
Join modules into one SVG path, i.e. for crisp rendering
predefined
false
No
Use 'defs' and 'use' elements in SVG, i.e. for compact output
xmlDeclaration
false
No
Prepend XML declaration to the SVG document
container
svg
No
Wrapping element (svg/svg-viewbox/g/none; see below)
SVG container options:
svg - populate squares in a SVG document with width and height attribute, recommended for converting to raster images or PDF where QR Code is being static (exact size)
svg-viewbox - populate squares in a SVG document with viewBox attriute, recommended for responsive web pages
g - put squares in g element, useful when you need to put multiple QR Codes in a single SVG document
none - no wrapper
Version History
This repo is a fork of qrcode-svg, itself a fork of qrcodejs. Both use client-side JavaScript to render QR codes in the browser, whereas this library is intended to run on the Marketing Cloud server. To make this possible, each function was downgraded to ECMAScript 3, removing references to the DOM along with unsupported features and keywords. Further optimizations and bug fixes can be submitted via a pull request.