13.4 GET_EAN8_SVG Function

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

Syntax

APEX_BARCODE.GET_EAN8_SVG (
    p_value             IN VARCHAR2,
    p_size              IN NUMBER   DEFAULT c_default_size,
    p_foreground_color  IN VARCHAR2 DEFAULT c_default_foreground_color,
    p_background_color  IN VARCHAR2 DEFAULT NULL )
    RETURN CLOB;

Parameters

Parameter Description
p_value Value to be encoded into the EAN 8 Barcode. Format is numeric with a maximum of 8 digits.
p_size Size of the EAN 8 Barcode (in pixels). Default 256px.
p_foreground_color Foreground color. Must be in hex code. Default #000000.
p_background_color Background color. Must be in hex code. Default null (transparent).

Returns

The SVG value of the EAN 8 barcode.

Raises

WWV_FLOW_BARCODE_API.NUMERIC_INPUT_ERROR: when p_value exceeds 8 digits.

Example

The following example generates an SVG EAN 8 type of barcode with specified foreground and background colors.

DECLARE
  l_output clob;
BEGIN
  l_output := apex_barcode.get_ean8_svg(
                  p_value            => '12345678',
                  p_foreground_color => '#4cd964',
                  p_background_color => '#c7c7cc');
  sys.dbms_outout.put_line( l_output );
END;