Platforms to show: All Mac Windows Linux Cross-Platform

Back to BarcodeGeneratorMBS class.

BarcodeGeneratorMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Barcode MBS Barcode Plugin 13.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The constructor.

BarcodeGeneratorMBS.Destructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Barcode MBS Barcode Plugin 13.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The destructor.

BarcodeGeneratorMBS.Encode(text as string, width as single = 0, height as single = 0, RotationAngle as Integer = 0)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Barcode MBS Barcode Plugin 13.5 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Encodes a barcode.
Example
dim b as new BarcodeGeneratorMBS
b.Symbology = b.BarcodeQrcode
b.Scale = 2
b.BorderWidth = 4
b.Encode "Hello Xojo Developer!"
Backdrop = b.Picture

If width is zero, we use automatic width.
If height is zero, we use automatic height. Default height for some 2D bars is 30 units.
RotationAngle can be 0, 90, 180 or 270.
You can set options before calling and query other properties (like picture after this)

BarcodeGeneratorMBS.SVG as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Barcode MBS Barcode Plugin 16.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates SVG as text.
Example
dim z as new BarcodeGeneratorMBS

// try QR Code
z.Symbology = BarcodeGeneratorMBS.BarcodeQrcode
z.Encode "Hello World"

dim s1 as string = z.SVG

// try SVG
z.Symbology = BarcodeGeneratorMBS.BarcodeEanX
z.Encode "123456789012"

dim s2 as string = z.SVG

break // check SVG

Lasterror and ErrorText are set.

BarcodeGeneratorMBS.WritePS(path as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Barcode MBS Barcode Plugin 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Write PS file.
Example
dim z as new BarcodeGeneratorMBS

z.Symbology = BarcodeGeneratorMBS.BarcodeUpca
z.Encode "72527270270"

dim f as FolderItem = SpecialFolder.Desktop.Child("barcode.eps")
dim e as Integer = z.WritePS(f.NativePath)
if z.ErrorText.len >0 then
MsgBox z.ErrorText
else
MsgBox "OK"
end if

Returns error code. Lasterror and ErrorText is also set.
File path should be ASCII only (other characters not guaranteed) and maybe point to temp file somewhere.

Some examples using this method:

BarcodeGeneratorMBS.WriteSVG(path as string) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Barcode MBS Barcode Plugin 14.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Write SVG file.
Example
dim z as new BarcodeGeneratorMBS

z.Symbology = BarcodeGeneratorMBS.BarcodeUpca
z.Encode "72527270270"

dim f as FolderItem = SpecialFolder.Desktop.Child("barcode.svg")
dim e as Integer = z.WriteSVG(f.NativePath)
if z.ErrorText.len >0 then
MsgBox z.ErrorText
else
MsgBox "OK"
end if

Returns error code. Lasterror is set.
ErrorText is also set.
File path should be ASCII only (other characters not guaranteed) and maybe point to temp file somewhere.

Some examples using this method:

The items on this page are in the following plugins: MBS Barcode Plugin.


The biggest plugin in space...