Widgets
Learn how to add barcode and qrcode in your document.
Barcode
Pdfless includes Barcode generator and supports multiple barcode formats.
You can add barcode with {{{barcode 'value' 'format' 'classname'}}}
syntax into your html.
Barcode
<aside>
<address id="from">
<h3>Synapsium SAS</h3>
10 boulevard de la République, 92250
La Garenne Colombes, France
@: contact@synapsium.com
</address>
</aside>
<div class="barcode-container">
{{{barcode 'CODE39 Barcode' 'CODE39' 'my_class_name'}}}
</div>
// You can also insert variable into snippet without simple quote
<div class="barcode-container">
{{{barcode variable_barcode_value variable_barcode_format 'my_class_name'}}}
</div>
Parameters
codebar
snippet has 3 parameters.
Parameter | Description | Type |
---|---|---|
Value (first parameter) | Value you want to convert to barcode | string |
Code (second parameter) | Format of barcode | Optional - string (default : CODE128 ) |
Class name (third parameter) | CSS class name of generated svg |
Optional - string |
You can define null
value if you don't want to set value to optional parameters.
Barcode
{{{barcode 'CODE39 Barcode' null null}}}
Supported format
Format | Code | Sample | About format |
---|---|---|---|
Code 128 | CODE128 |
Example\1234 |
It supports all 128 ASCII characters but does also encode numbers. |
Code 39 | CODE39 |
CODE39 Barcode |
It encodes numbers, uppercase letters and a number of special characters (-, ., $, /, +, %, and space) |
International Article Number | EAN13 |
5901234123457 |
Only 13 Digits supported. |
International Article Number | EAN8 |
96385074 |
Only 8 Digits supported. |
International Article Number | EAN5 |
54495 |
`Only 5 Digits supported. |
International Article Number | EAN2 |
43 |
Only 2 Digits supported. |
Universal Product Codes | UPC |
123456789999 |
UPC specification with only 12 digits. |
Interleaved 2 of 5 | ITF14 |
12345678901231 |
It encodes 14 digits and the last digit of an ITF-14 barcode is an checksum that it will be calculated automatically if it is left out. |
Modified Plessey | MSI |
1234 |
It supports digits 0-9. |
Modified Plessey | MSI10 |
1234 |
It supports digits 0-9 and it provides checksum calculation of Mod 10. Result will be 12344. |
Modified Plessey | MSI11 |
1234 |
It supports digits 0-9 and it provides checksum calculation of Mod 11. Result will be 12343. |
Modified Plessey | MSI1010 |
1234 |
It supports digits 0-9 and it provides checksum calculation of Mod 1010. Result will be 123448. |
Modified Plessey | MSI1110 |
1234 |
It supports digits 0-9 and it provides checksum calculation of Mod 1110. Result will be 123430. |
Pharmacode | pharmacode |
1234 |
Pharmacode is a barcode used in the pharmaceutical industry. It can encode numbers 3 to 131070. |
Codabar | codabar |
C1234567890D |
It encodes numbers and a number of special characters (–, $, :, /, +, .). You can set start and stop characters to A, B, C or D but if no start and stop character is defined A will be used. |