QR Codes

It's easy to add QR codes to your documents with TemplateDocs. The QR code tag syntax is the same as a simple text tag:

{{ MyQRCode }}

Provide the QR code details in your JSON data using the QR code object structure shown below:

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

This will create a QR code that encodes "https://templatedocs.io" with default settings (black on white, 4px margin, auto-sized).

QR Code Example

Using Image Placeholders

QR codes can also be inserted using image placeholders. This allows you to replace existing images in your template with generated QR codes. To mark an image as a placeholder, insert a tag in its alt text. Then use the same JSON data as you would for a regular QR code tag. For example:

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

QR Code Properties

PropertyTypeDescription
_typestring
Must be set to "qrcode"
datastring
Required. Text to encode in the QR code
sizenumber
Optional. Width and height of the QR code in pixels (QR codes are always square)
colorstring
Optional. Foreground color in hex format (e.g. "#000000"). Default is black
backgroundstring
Optional. Background color in hex format (e.g. "#ffffff"). Default is white
marginnumber
Optional. Margin around the QR code in pixels. Default is 4

Examples

Simple QR Code

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

This creates a QR code with default settings (black on white, 4px margin, auto-sized).

Simple QR Code Example

Custom Styled QR Code

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

This creates a blue QR code on a light gray background with custom size and margin.

Styled QR Code Example

Common Use Cases

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

This creates a QR code that allows users to send an email when scanned.

Email QR Code Example

Phone Numbers

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

This creates a QR code that allows users to call the number when scanned.

Phone QR Code Example
This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

This creates a QR code that allows users to send an SMS message when scanned.

SMS QR Code Example

WiFi credentials

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

This creates a QR code that allows users to automatically connect to a WiFi network when scanned.

WiFi QR Code Example

Google Maps

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

This creates a QR code that allows users to view a Google Maps location when scanned.

Google Maps QR Code Example

Contact information

This preview shows the tag fields exactly as they appear in the TemplateDocs UI.

This creates a QR code that allows users to save contact information when scanned.

Contact QR Code Example
QR Codes - TemplateDocs Documentation