Get Barcode
Verb: getBarcode
Available from: <Enterprise>
Gets one or more barcodes from an image or a PDF file.
Syntax
getBarcode --sourcetype(BarcodeSourceType) --image(Image) --pdf(Pdf) --pdfpage(Numeric) [--codepositionfrom(Boolean)] --codeposition(Numeric) --format(Nullable<BarcodeFormat>) [--retry(Boolean)] --step(Numeric) --max(Numeric) (DataTable)=table (String)=code (String)=type (Boolean)=success
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--sourcetype | Source | Required | BarcodeSourceType | Type of the file where the barcodes are. Options:
|
--image | Image | Only whenSource is Image | Image, Text | Image file containing barcodes. |
Only whenSource is Pdf | PDF, Text | PDF file containing barcodes. | ||
--pdfpage | Page to be read | Only whenSource is Pdf | Number | Page number of the PDF file containing the barcode. |
--codepositionfrom | Barcode position | Optional | Boolean | When enabled, allows choosing the barcode position according to the order in which the codes are arranged in the file. |
--codeposition | Barcode position order | Only whenBarcode position is True | Number | Position where the barcode is at. |
--format | Format | Required | BarcodeFormat | Barcode Type. |
--retry | Retry | Optional | Boolean | When enabled, repeats the command execution if the barcode is not obtained on the first try. |
--step | Step | Only whenRetry is True | Number | The zoom percentage applied to the barcode on each attempt. |
--max | Max zoom | Only whenRetry is True | Number | The maximum zoom that can be applied after retries. |
--fromfile | Get from file(Obsolete) | Optional | Boolean | When enabled, defines that a file will provide the barcode.
This parameter is obsolete, use the Source parameter instead. |
--imagepath | Image path(Obsolete) | Only whenGet from file is True | Text | Image path of the file that contains the barcode.
This parameter is obsolete, use the Source parameter instead. |
--frompdf | Get from PDF(Obsolete) | Optional | Boolean | When enabled, defines that the a PDF file will provide the barcode. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
table | List of codes and types | Data Table | Returns a list of the value of each barcode and its types. |
code | Code of image | Text | Returns the barcode obtained according to position. |
type | Type of barcode | Text | Returns the barcode type obtained according to position. |
success | Success | Boolean | Returns "True" if the execution got the barcode, or "False" if it didn't. |
Example
The Get Barcode command gets barcodes according to the type defined in the Format parameter.
defVar --name codes --type DataTable
defVar --name imageCode --type String
defVar --name codeType --type String
defVar --name success --type Boolean
//Download the file below to test the script.
getBarcode --sourcetype "Image" --image "QRCodeImage.png" --format "QR_CODE" imageCode=code codeType=type codes=table success=success
//Displays in the console the value of each barcode obtained and its type.
logMessage --message "\r\n${codes}\r\n${imageCode}\r\n${success}\r\n${codeType}" --type "Info"
To execute the script above, you need to download the file and insert the path to where it was saved, in the Image parameter.
Remarks
The value inserted in the Step parameter, added to the already existing zoom at the first command execution, must be less than the value entered in the Max zoom parameter.