PL/BARCODE — Barcode Generation for Oracle PL/SQL
Generate linear and 2D barcodes directly in Oracle Database. Return a PNG image or a standalone vector PDF as an Oracle BLOB.
Use a single PL/SQL package for product labels, shipping and inventory workflows, and payment documents. The package uses built-in Oracle Database facilities for encoding and rendering.
Use the same barcode in applications and documents
PNG images
Return a 1-bit grayscale PNG BLOB for application screens, labels and document workflows.
Vector PDFs
Generate a one-page PDF BLOB with the symbol drawn as vector shapes.
PL/DOC integration
Read the modules, bars and horizontal spans to draw the barcode as vector rectangles inside a larger PL/DOC report.
Supported barcode formats
| Format | Supported profiles |
|---|---|
| QR Code | Model 2, versions 1–40, with L, M, Q and H error correction |
| Swiss QR | Payment profile with ECC M and a default active symbol size of 46 × 46 mm |
| Micro QR | Versions M1–M4 with version-specific error correction |
| Code 128 and GS1-128 | Code sets A, B and C, automatic code-set selection and FNC1 |
| EAN-13 and UPC-A | GTIN check digit calculation and validation |
| Code 39, ITF and POSTNET | Optional checksums for Code 39 and ITF, and postal bar heights for POSTNET |
| Data Matrix | Classic ECC200, square and rectangular symbols |
| PDF417 | Text, numeric and byte compaction, with error correction levels 0–8 |
| Aztec Code | Compact and Full symbols |
Supply a complete SPC payload for Swiss QR and a serialized element string for GS1-128. The calling application validates those data fields and places the Swiss cross in the finished QR-bill layout.
Generate a QR code in PL/SQL
Encode a URL once and render the same symbol as PNG and vector PDF.
declare
l_qr pl_barcode.t_qr;
l_png blob;
l_pdf blob;
begin
l_qr := pl_barcode.generate_qr(
p_text => 'https://plslash.com',
p_ecc => 'M'
);
l_png := pl_barcode.to_png(l_qr, p_pixels_per_module => 8);
l_pdf := pl_barcode.to_pdf_vector(l_qr, p_symbol_mm => 30);
-- Store or stream both BLOBs before releasing them.
dbms_lob.freetemporary(l_png);
dbms_lob.freetemporary(l_pdf);
pl_barcode.free_qr(l_qr);
end;
/
Tested on Oracle Database 21c XE
The v7.0 regression passed on Oracle Database 21c XE. It covered 14 acceptance and boundary suites, seven PL/DOC integration suites, and checks on the generated PNG and PDF files.
Try PL/BARCODE
Request an evaluation for your Oracle environment and ask for the v7.0 User Guide and sample scripts.
