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:
9.4
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
Statistic
FMM
Blog
Barcode.SetOptions
Sets options for barcode creation.
Component | Version | macOS | Windows | Linux | Server | FileMaker iOS SDK |
Barcode | 4.3 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
Option1 | The first option. | 1 | Optional |
Option2 | The second option. | 1 | Optional |
Option3 | The third option. | 1 | Optional |
Result
Returns OK.
Description
Sets options for barcode creation.Creating a barcode will reset those options to zero for next barcode.
For QRCode:
Option1 is the ECC Level with values from 1 = low, 2 = middle, 3 = better, 4 high. Default is low.
Option2 is version code from 1 to 40. Default is 0 to auto select.
For MicroQR you can use ECC Level 1 to 3 as 4 is not supported.
For Data Matrix:
Option2 size from 1 to 30. 0 is auto. See table in zint manual pdf.
Option3 can be 100 to force square size.
For Code 39:
You can set Option2 to 1 to add module 43 checksum.
For MaxiCode:
Option 1 is the mode.
For PDF 417:
Option 1 is a number between 0 and 8 where the number of codewords used for check information is determined by 2^(value + 1).
Option 2 is the number of columns between 1 and 30.
See also Barcode.DrawBarcode, Barcode.WriteFile and Barcode.Generate.
Examples
Set better ECC level for QRCode:
MBS( "Barcode.SetOptions"; 3)
Set square option for data matrix:
MBS( "Barcode.SetOptions"; 0; 0; 100 )
Create QRCode with UTF-8 and size 10:
Set Field [Barcode Generation::Image; ""]
#Better error correction and size 10
Set Variable [$r; Value:MBS( "Barcode.SetOptions"; 3; 10 )]
#Generate QRCode with UTF-8
Set Variable [$img; Value:MBS("Barcode.Generate"; "QRCode"; Barcode Generation::Text; 0; 0; 0; 1; 0; 1; "UTF-8")]
If [GetAsNumber($img) > 0]
Set Field [Barcode Generation::Image; MBS( "GMImage.WriteToPNGContainer"; $img; "barcode.png")]
Set Variable [$r; Value:MBS( "GMImage.Release"; $img )]
End If
Create a data matrix barcode with size 10 and return as container:
Let ( [
// set options for Size 10 (32x32) square for data matrix
r = MBS("Barcode.SetOptions"; 0; 10; 100);
// create a data matrix barcode
p = MBS("Barcode.Generate"; "DATAMATRIX"; "12818670,3,1" ; 0; 0; 0; 4);
// success?
e1 = MBS("IsError");
// save as PNG
image = MBS( "GMImage.WriteToPNGContainer"; p; "barcode.png" );
// success?
e2 = MBS("IsError");
// free image from memory
r = MBS("GMImage.Release"; p)
// return container if no error
]; If(e1 = 0 and e2 = 0; image; "") )
Create Maxicode with mode 3:
Set Variable [ $p ; Value: "196LS97TF826004" // primary text ]
Set Variable [ $t ; Value: "1Z42015596UPSN123W123456/11NLEEDS" // second text ]
Set Variable [ $r ; Value: MBS("Barcode.SetOptions"; 3) ]
Set Variable [ $r ; Value: MBS("Barcode.SetPrimary"; $p) ]
Set Variable [ $img ; Value: MBS("Barcode.Generate"; "maxicode"; $t) ]
See also
- Barcode.DrawBarcode
- Barcode.Generate
- Barcode.GetOption
- Barcode.SetOption
- Barcode.SetPrimary
- Barcode.WriteFile
- GMImage.Release
- GMImage.WriteToPNGContainer
- IsError
Example Databases
Blog Entries
- Swiss QR-Codes for invoices as vector graphics
- QR Codes for Invoices in Switzerland
- MBS Filemaker Plugin, version 4.3pr4
FileMaker Magazin
Created 18th August 2014, last changed 22nd February 2020
Barcode.SetOption - Barcode.SetPrimary
Feedback: Report problem or ask question.

Links
MBS Xojo PDF Plugins