13.3 GET_EAN8_PNG Function

This function generates an EAN 8 barcode that is configured according to the specified options, and returns a BLOB in PNG format.

Syntax

APEX_BARCODE.GET_EAN8_PNG (
    p_value             IN VARCHAR2,
    p_scale             IN NUMBER   DEFAULT c_default_scale,
    p_foreground_color  IN VARCHAR2 DEFAULT c_default_foreground_color,
    p_background_color  IN VARCHAR2 DEFAULT NULL )
    RETURN BLOB;

Parameters

Parameter Description
p_value Value to be encoded into the EAN 8 barcode. Must be numeric with a maximum of 8 characters.
p_scale Makes the orignial PNG p_scale times larger (integer 1-10). Default is 1. The original size is determined by the input length.
p_foreground_color Foreground color. Must be in hex code. Defaults is #000000.
p_background_color Background color. Must be in hex code. Default is null (transparent).

Returns

The EAN 8 barcode PNG image file.

Raises

WWV_FLOW_BARCODE_API.NUMERIC_INPUT_ERROR: when p_value exceeds 8 characters.

Example

The following example generates a PNG EAN 8 type of barcode file with desired scale, foreground color, and background color.

DECLARE
  l_output blob;
BEGIN
  l_output := apex_barcode.get_ean8_png(
                  p_value            => '12345678',
                  p_scale            => 1,
                  p_foreground_color => '#4cd964',
                  p_background_color => '#c7c7cc' );

END;