Barcodes
Updated on Aug 7, 2023 3 minutes to readTo utilize the methods offered by this plugin, you should call them through the E8App.$barcodes object.
Download Barcode URL
Syntax:
E8App.$barcodes.getDownloadURL(<config>, <schema - optional>, <params - optional>)
Description:
Generates a visual form of a barcode (image) according to the provided parameters.
Parameters:
<config> - required
Type: Object
Parameters of a barcode image.
{ type: <string> (all types of barcodes are available in barcodes Properties),
value: <string> (value encoded in a barcode, should match the barcode format, otherwise you get an exception),
height: <number> - size of a barcode image in px,
width: <number> - size of a barcode image in px }
<schema> - optional (default = false)
Type: Boolean
This parameter describes the type of the desired link: True - absolute link is returned, False - relative link is returned.
<params> - optional
Type: Object
Additional parameters of a barcode image.
{ “basename”: <string> a filename with file extension,
“filename”: <string> a filename without file extension }
Returned value:
A link for downloading a barcode.
Type: String.
E8App.$barcodes.getDownloadUrl({ type: E8App.$barcodes.QRCODE_M, value: 'https://google.ca', height: 300, width: 300 }, true);
Save Barcode
Syntax:
E8App.$barcodes.save(<config>, <params - optional>)
Description:
Downloads the barcode in image format.
Parameters:
<config> - required
Type: Object
Parameters of a barcode image.
{ type: <string> (all types of barcodes are available in barcodes Properties),
value: <string> (value encoded in a barcode, should match the barcode format, otherwise you get an exception),
height: <number> - size of a barcode image in px,
width: <number> - size of a barcode image in px }
<params> - optional
Type: Object
Additional parameters of a barcode image.
{ “basename”: <string> a filename with file extension,
“filename”: <string> a filename without file extension }
Returned value:
Type: Object.
The promise resolves to the image file information representing the response to your request.
{ "appId": <string>,
"id": <string>,
"name": <string>,
"text": <string>,
"extension": <string>,
"size": <number>,
"mimeType": <string>,
"isImage": <boolean>,
"isVideo": <boolean>,
"isPreviewSupported": <boolean>,
"isPublic": <boolean> }
E8App.$barcodes.save({ type: E8App.$barcodes.QRCODE_M, value: 'https://google.ca', height: 300, width: 300 },{ basename: 'qr.jpeg' }) .then((fileInfo) => {console.log(fileInfo);})
Properties
Property contains the available certain type of a barcode EAN, PDF417, QRCODE, etc.
E8App.$barcodes.QRCODE_L