Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
11.3
11.4
Statistic
FMM
Blog
Generates a barcode.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
Barcode | 9.4 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
JSON | The JSON block with all options. | { "symbology": "QRCode", "Text": "Hello World", "Scale": 4 } |
Returns GMImage reference or error.
Key | Value | Example |
Symbology | Symbol to use. Can be number or text name. | QRCode |
Text | Human readable text, which usually consists of input data plus one more check digit. | "Hello World" |
Transparent | Transparency mode: 0: black on white, 1: black on transparent background, 2: white on black, 3: white on transparent background | 0 |
Rotation | Rotation angle to use. Multiply of 90°. | 0 |
ShowText | Whether to show text. Pass 0 to hide text. | 1 |
WhitespaceWidth | Whitespace width. | 5 |
BorderWidth | Border width. | 5 |
OutputOptions | Set various output file options as number. | 0 |
Scale | Scale factor for adjusting size of image. Usually 4 or bigger for printing in high resolution. | 4 |
Option1 | Symbol specific options. | 0 |
Option2 | Symbol specific options. | 0 |
Option3 | Symbol specific options. | 0 |
InputMode | Set encoding of input data. Pass 0 for data, 1 for unicode. | 1 |
ECI | Extended Channel Interpretation mode. | 3 |
DotSize | Size of dots used in dotty mode. | 1.25 |
Primary | Primary message data for more complex symbols. "" | |
ForeGroundColor | Foreground (ink) colour as RGB hexadecimal string. Must be 6 characters. | "ff0000" |
BackGroundColor | Background (paper) colour as RGB hexadecimal string. Must be 6 charaters. | "0000ff" |
OutputFile | Contains the name of the file to output a resulting barcode symbol to. Must end in .png, .gif, .eps, .pcx, .svg or .txt. | "C:\test.png" |
Create barcode based on JSON:
Set Field [ Barcode Generation JSON::Image ; "" ]
Set Variable [ $img ; Value: MBS("Barcode.GenerateJSON"; Barcode Generation JSON::JSON) ]
If [ MBS("IsError") = 0 ]
Set Field [ Barcode Generation JSON::Image ; MBS( "GMImage.WriteToPNGContainer"; $img; "barcode.png") ]
Set Variable [ $r ; Value: MBS( "GMImage.Release"; $img ) ]
Else
Show Custom Dialog [ "Failed to create barcode" ; $img ]
End If
Created 5th September 2019, last changed 27th December 2019
Barcode.Generate - Barcode.GetInputMode
Feedback: Report problem or ask question.