Generate SVG and PNG Barcodes in Oracle APEX

Search for a command to run...

Oracle APEX already includes Font APEX as the default icon library for Universal Theme. In most cases, that is enough. But in one of my APEX apps, I needed a few icons that were not available there, s

Looking to give your Oracle APEX mobile app a modern, native feel? Here’s a quick hack: add a floating action button that stays anchored at the bottom corner just like in popular mobile apps. This sma

APEX 26.1 has been updated to the Universal Theme. While much of the attention in this release is on AI features, I think the UT improvements are just as important for developers like me who care abou

Oracle APEX makes it easy to get data on screen fast, but often, the default tabular output isn’t enough. What if you want to highlight statuses, add icons, or display badges all without writing compl

The apex_barcode package offers a PL/SQL API to generate various types of barcodes. You can output barcodes as SVG (Scalable Vector Graphics) values or as PNG file blobs, making it easy to embed them in your APEX apps, reports, or documents.
declare
l_output blob;
begin
l_output := apex_barcode.get_code128_png(
p_value => 'https://apexblog.dev/',
p_scale => 1,
p_foreground_color => '#4cd964',
p_background_color => '#c7c7cc' );
end;
declare
l_output clob;
begin
l_output := apex_barcode.get_code128_svg(
p_value => 'https://apexblog.dev/',
p_foreground_color => '#4cd964',
p_background_color => '#c7c7cc' );
dbms_outout.put_line( l_output );
end;
We can also generate in a EAN8 format using apex_barcode.get_ean8_png and apex_barcode.get_ean8_svg
for svg: use a pl/sql dynamic content region to output the svg directly.
for png: store the blob in a table and use an image item or blob download link to display or let users download the barcode.
In conclusion, the apex_barcode package in Oracle APEX 24.2 provides a robust and flexible solution for generating barcodes in your applications. With support for both SVG and PNG outputs, it caters to a wide range of needs, whether for web integration, print, or other systems. By leveraging this PL/SQL-driven package, you can easily embed barcodes in APEX pages. Whether you need to display barcodes directly on a page or allow users to download them, the apex_barcode package simplifies the process, making it an essential tool for modern APEX dev.