Platforms to show: All Mac Windows Linux Cross-Platform
/DynaPDF/Create PDF with Barcodes
Required plugins for this example: MBS DynaPDF Plugin
You find this example project in your Plugins Download as a Xojo project file within the examples folder: /DynaPDF/Create PDF with Barcodes
This example is the version from Sun, 14th Nov 2020.
Project "Create PDF with Barcodes.xojo_binary_project"
Class App Inherits Application
Const kEditClear = "&Delete"
Const kFileQuit = "&Quit"
Const kFileQuitShortcut = ""
EventHandler Sub Open()
Dim d As New DynapdfMBS
dim file as FolderItem
d.SetLicenseKey "Starter" // For this example you can use a Starter, Lite, Pro or Enterprise License
file=SpecialFolder.Desktop.Child("Create PDF with Barcodes.pdf")
call d.CreateNewPDF file
call d.Append
// UPCA
Dim b1 As New DynaPDFBarcode2MBS
b1.BarcodeType = b1.kbctUPCA
b1.Data = "72527270270"
Call d.InsertBarcode(100, 100, 200, 50, d.kcoLeft, d.kcoTop, b1)
// UPCA
Dim b2 As New DynaPDFBarcode2MBS
b2.BarcodeType = b1.kbctUPCA
b2.Data = "72527270270+12345"
Call d.InsertBarcode(100, 200, 200, 50, d.kcoLeft, d.kcoTop, b2)
// UPCE
Dim b3 As New DynaPDFBarcode2MBS
b3.BarcodeType = b1.kbctUPCE
b3.Data = "1123456"
Call d.InsertBarcode(100, 300, 200, 50, d.kcoLeft, d.kcoTop, b3)
// EANX
Dim b4 As New DynaPDFBarcode2MBS
b4.BarcodeType = b1.kbctEANX
b4.Data = "54321"
Call d.InsertBarcode(100, 400, 200, 50, d.kcoLeft, d.kcoTop, b4)
// EANX
Dim b5 As New DynaPDFBarcode2MBS
b5.BarcodeType = b1.kbctEANX
b5.Data = "7432365+54321"
Call d.InsertBarcode(100, 500, 200, 50, d.kcoLeft, d.kcoTop, b5)
// CODE39
Dim b6 As New DynaPDFBarcode2MBS
b6.BarcodeType = b6.kbctCode39
b6.Data = "CODE39"
Call d.InsertBarcode(100, 600, 200, 50, d.kcoLeft, d.kcoTop, b6)
// PDF417
Dim b7 As New DynaPDFBarcode2MBS
b7.BarcodeType = b1.kbctPDF417
b7.Data = "Hello World, Just a test. 123"
Call d.InsertBarcode(300, 100, 200, 50, d.kcoLeft, d.kcoTop, b7)
// DataMatrix
Dim b8 As New DynaPDFBarcode2MBS
b8.BarcodeType = b1.kbctDataMatrix
b8.Data = "Hello World"
Call d.InsertBarcode(300, 200, 200, 50, d.kcoLeft, d.kcoTop, b8)
// QRCode
Dim b9 As New DynaPDFBarcode2MBS
b9.BarcodeType = b1.kbctQRCode
b9.Data = "Hello World"
Call d.InsertBarcode(300, 300, 200, 50, d.kcoLeft, d.kcoTop, b9)
// QRCode
Dim b10 As New DynaPDFBarcode2MBS
b10.BarcodeType = b1.kbctQRCode
b10.Data = "Hello World, Just a test. 123"
// Option1 for QRCode is the ECC Level with values from 1 = low, 2 = middle, 3 = better, 4 high. Default is low.
b10.Option1 = 4
Call d.InsertBarcode(300, 400, 200, 50, d.kcoLeft, d.kcoTop, b10)
// EAN128
Dim b11 As New DynaPDFBarcode2MBS
b11.BarcodeType = b1.kbctEAN128
b11.Data = "[00]993262210000005384"
b11.BorderWidth = 5 // with border around
b11.Options = b11.kbcoBox
b11.FgColor = d.RGB(100, 0, 0)
Call d.InsertBarcode(300, 500, 200, 50, d.kcoLeft, d.kcoTop, b11)
// OneCode USPS
Dim b12 As New DynaPDFBarcode2MBS
b12.BarcodeType = b1.kbctUSPSOneCode
b12.Data = "01234567094987654321-012345678"
Call d.InsertBarcode(300, 600, 200, 50, d.kcoLeft, d.kcoTop, b12)
call d.EndPage
call d.CloseFile
file.Launch
End EventHandler
End Class
MenuBar MenuBar1
MenuItem FileMenu = "&File"
MenuItem FileQuit = "#App.kFileQuit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu1 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "#App.kEditClear"
MenuItem UntitledMenu0 = "-"
MenuItem EditSelectAll = "Select &All"
End MenuBar
End Project
See also:
- /DynaPDF/Create PDF UA
- /DynaPDF/Create PDF with Arc
- /DynaPDF/Create PDF with bezier curve
- /DynaPDF/Create PDF with Circle
- /DynaPDF/Create PDF with Dashed Line
- /DynaPDF/Create PDF with Image FileLink
- /DynaPDF/Create PDF with paths
- /DynaPDF/Create PDF with Round Rectangles
- /DynaPDF/Create PDF with text block
- /DynaPDF/Create PDF with Zapf Dingbats
The items on this page are in the following plugins: MBS DynaPDF Plugin.