Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
Generates a barcode and writes to file.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Barcode | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
type | Which file type to generate. Can be PNG, TIFF, JPEG, SVG or PS. |
"SVG" | |
path | The file path to use. Currently limited to 255 characters for SVG and PS. |
"/tmp/test.svg" | |
symbology | The symbology to use. e.g. EANX for EAN-13. | "EANX" | |
Text | The text to encode in the barcode. | "12345" | |
width | The desired width of the barcode in pixels. Zero gives the auto size. | 0 | Optional |
height | The desired height of the barcode in pixels. Zero gives the auto size. | 0 | Optional |
rotation | The rotation. Can be 0, 90, 180 or 270. | 0 | Optional |
scale | The scale of the target image. Please use at least 4 for printing the barcode. |
1.0 | Optional |
transparent | Pass 1 to have the white background being transparent. | 1 | Optional |
ShowText | Whether to show text. Use 0 to hide text or 1 to show text. | 1 | Optional |
Encoding | The text encoding for text parameter. Default is UTF-8. Possible encoding names: ANSI, ISO-8859-1, Latin1, Mac, Native, UTF-8, DOS, Hex, Base64 or Windows. More listed in the FAQ. |
UTF8 | Optional |
Returns OK or error.
Creates UPCA barcode:
MBS( "Barcode.WriteFile"; "JPEG"; "/tmp/test.jpg"; "UPCA"; "72527270270")
Create ISDN 9780271016368 barcode with EAN:
MBS( "Barcode.WriteFile"; "SVG"; "/tmp/test.svg"; "EANX"; "978027101636")
Creates extended barcode with plus sign:
MBS( "Barcode.WriteFile"; "SVG"; "/tmp/test.svg"; "EANX"; "978027101636+90000")
Write JPEG file with EAN 128
MBS( "Barcode.WriteFile"; "jpg"; "/tmp/test.jpg"; "EAN128"; "[01]98898765432106[3202]012345[15]991231")
This function checks for a license.
Created 18th August 2014, last changed 19th June 2023