Barcodes
(mPDF ≥ 4.0)
A variety of barcodes can be produced with mPDF. Please see the example file for more information.
Note: As of mPDF 8.0, composer package mpdf/qrcode is needed for generating QR codes automatically.
Specifications in mPDF
All values in millimeters, unless specified as a factor of X-dim e.g. 10X.
X = width of narrowest bar (also known as module width)
Pr ratio is ratio of narrow bar to wide bar
| Barcode type | $code | X-dim | H-dim | Light margin / Quiet zone | D:A:F:T1 | Pr ratio | ||
|---|---|---|---|---|---|---|---|---|
| Left | Right | Top/bottom | ||||||
| EAN-13 | EAN13, ISBN, ISSN | 0.33 | 25.93 | 11X | 7X | 0 | ||
| UPC-A | UPCA | 0.33 | 25.91 | 9X | 9X | 0 | ||
| UPC-E | UPCE | 0.33 | 25.93 | 9X | 7X | 0 | ||
| EAN-8 | EAN8 | 0.33 | 21.64 | 7X | 7X | 0 | ||
| Intelligent Mail barcode | IMB | 0.508 | 3.68 | 3.175 | 3.175 | 0.711 | 2:2:3:1 | |
| Royal Mail 4-state Customer barcode | RM4SCC | 0.508 | 5.0 | 2 | 2 | 2 | 5:5:8:2 | |
| Royal Mail 4-state Customer barcode (Dutch) | KIX | 0.508 | 5.0 | 2 | 2 | 2 | 5:5:8:2 | |
| POSTNET | POSTNET | 0.508 | 3.175 | 3.175 | 3.175 | 1.016 | 5:2 | |
| PLANET | PLANET | 0.508 | 3.175 | 3.175 | 3.175 | 1.016 | 5:2 | |
| Code 128 | C128A, C128B, C128C | 0.381 | 10 | 10X | 10X | 0 | - | |
| UCC/EAN-128 (GS1-128) | EAN128A, EAN128B, EAN128C | 0.381 | 10 | 10X | 10X | 0 | - | |
| Code 39 (Code 3 of 9) | C39, C39+, C39E, C39E+ | 0.381 | 10 | 10X | 10X | 0 | 
         2.53  | 
|
| Standard 2 of 5 | S25, S25+ | 0.381 | 10 | 10X | 10X | 0 | 
         34  | 
|
| Interleaved 2 of 5 | I25, I25+, I25B, I25B+ | 0.381 | 10 | 10X | 10X | 0 | 
         2.53  | 
|
| Code 93 | C93 | 0.381 | 10 | 10X | 10X | 0 | - | |
| MSI (Modified Plessey) | MSI, MSI+ | 0.381 | 10 | 12X | 12X | 0 | - | |
| CODABAR | CODABAR | 0.381 | 10 | 10X | 10X | 0 | 
         2.53  | 
|
| Code 11 | CODE11 | 0.381 | 10 | 10X | 10X | 0 | 
         35  | 
|
All values in millimeters, unless specified as a factor of X-dim e.g. 10X.
X = width of narrowest bar (also known as module width)
Pr ratio is ratio of narrow bar to wide bar
Notes: