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

FormatSupported profiles
QR CodeModel 2, versions 1–40, with L, M, Q and H error correction
Swiss QRPayment profile with ECC M and a default active symbol size of 46 × 46 mm
Micro QRVersions M1–M4 with version-specific error correction
Code 128 and GS1-128Code sets A, B and C, automatic code-set selection and FNC1
EAN-13 and UPC-AGTIN check digit calculation and validation
Code 39, ITF and POSTNETOptional checksums for Code 39 and ITF, and postal bar heights for POSTNET
Data MatrixClassic ECC200, square and rectangular symbols
PDF417Text, numeric and byte compaction, with error correction levels 0–8
Aztec CodeCompact 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.

PLslash
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.