Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

Barcode.SetOptions

Sets options for barcode creation.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
Barcode 4.3 Yes Yes Yes Yes Yes

MBS( "Barcode.SetOptions" { ; Option1; Option2; Option3 } )

Parameters

Parameter Description Example value
Option1 Optional
The first option.
1
Option2 Optional
The second option.
1
Option3 Optional
The third option.
1

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 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:
Option1 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.Destroy"; $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.Destroy"; p)
// return container if no error
]; If(e1 = 0 and e2 = 0; image; "") )

See also


Barcode.ISBNChecksum   -   Barcode.SetPrimary

Feedback: Report problem or ask question.




Links
MBS Xojo PDF Plugins