How to PDF Barcodes QR Codes
Barcodes and QR codes in PDFs enable scannable shipping labels, event tickets, product catalogs, and inventory documents. Embedding them directly in the PDF ensures they print at full resolution and scan reliably from paper. SublimePDF supports inline barcode and QR code generation through template helpers and SVG rendering, eliminating the need for external image services.
Follow the step-by-step instructions below, then use the free tool directly — no registration or download required.
Open Tool →How to PDF Barcodes QR Codes — Step by Step
Add a QR code with the built-in helper
Use the SublimePDF template helper in your HTML: {{qrcode value='https://example.com/ticket/12345' size=150}}. This renders an inline SVG QR code at the specified size in pixels. The value can be any string — URLs, IDs, JSON payloads.
Generate barcodes in common formats
Use {{barcode value='123456789012' format='EAN13' height=80}} for standard barcode formats. Supported formats include Code128, Code39, EAN13, EAN8, UPC-A, ITF-14, and Codabar. Each format has specific character and length requirements.
Position codes in your layout
The barcode and QR code helpers output inline SVG elements. Wrap them in positioned <div> elements and use CSS for alignment: text-align: center, float: right, or absolute positioning within a relative container.
Add human-readable text below barcodes
Set displayValue=true in the barcode helper to render the encoded value as text below the barcode: {{barcode value='ABC-123' format='Code128' displayValue=true}}. Customize the text font size with fontSize=14.
Use dynamic data for unique codes
Combine barcode helpers with template variables: {{qrcode value=ticketUrl size=120}}. In a loop, each item generates its own unique code: {{#each products}}{{barcode value=this.sku format='Code128'}}{{/each}}.
Pro Tips
- 💡 For shipping labels, use Code128 barcodes at a minimum height of 80px and add a 'quiet zone' (white padding) of at least 10px on each side to ensure reliable scanning.
- 💡 QR codes should encode short strings when possible — URLs, IDs, or short JSON. Long payloads produce dense QR codes that may not scan reliably when printed on small labels.
- 💡 Always test barcode and QR code scannability by printing the generated PDF at actual size and scanning with a physical reader or phone camera before production deployment.
- 💡 SVG-based barcodes remain sharp at any print resolution, unlike raster images. This is why SublimePDF uses SVG rendering by default.
Privacy & Security
All processing happens directly in your browser. Your files are never uploaded to any server — they remain on your device throughout the entire process. SublimePDF uses WebAssembly technology for fast, secure, client-side processing.
Works Everywhere
This tool works on any modern browser — Chrome, Firefox, Safari, or Edge — on desktop, tablet, or mobile. No software to install. PDF is an open ISO standard supported by all major platforms.
How to PDF Barcodes QR Codes — FAQ
What barcode formats are supported?
Can I customize the QR code's colors?
Will the barcodes scan when printed?
Can I add a logo to the center of a QR code?
Related Guides
How to Add Page Numbers to PDF
Adding page numbers to a PDF makes documents easier to navigate and reference. Whether it's a report, manuscript, or legal document, SublimePDF lets you add customizable page numbers in seconds.
How to Convert Scanned PDF to Text
Scanned PDFs are essentially images — you can't select or search the text. OCR (Optical Character Recognition) technology converts these image-based PDFs into searchable, editable text. SublimePDF's OCR tool handles this conversion right in your browser.
How to Fill Out a PDF Form Online
Many important forms — tax documents, applications, contracts — come as PDF files. SublimePDF lets you fill them out directly in your browser without printing, handwriting, and scanning.