Wiki Home

Bar Tender


Namespace: VFP
Label Printing Software for Windows. Includes text and barcodes.

http://www.seagullscientific.com
Sample code to print out a label with a set of ASCII records.

# DEFINE btDoNotSaveChanges	        1
# DEFINE btCloseOutFirstFormat	    1
# DEFINE btDefaultDatabaseName      'Text File 1'
# DEFINE btShowStatusWindow	        1
# DEFINE btDoNotShowPrintDialog	    0

oBartender = CreateObject("BarTender.Application")

oLabel = oBartender.Formats.Open("C:\SomeBartenderLabel.btw",btCloseOutFirstFormat,"SomeWindowsPrinterName")

oLabel.Databases(btDefaultDatabaseName).Textfile.Filename = "C:\AsciiRecords.txt"

oLabel.PrintOut(btShowStatusWindow,btDoNotShowPrintDialog)

oBartender.Quit(btDoNotSaveChanges)

oBartender = null
oLabel     = null

Paul Borowicz

I used automation to insertISBN codes and a book title into a pre-made template.
oBarCode = CREATEOBJECT("BarTender.Application")
oBarCode.Visible=.F.

*Loading the template
oBar = oBarCode.Formats.Open("Template Location", 1, "Printer Name")

*Text boxes in template are given a SubString Name in the properties pop-up.		
oBar.SetNamedSubStringValue("Publisher","57461"))
oBar.SetNamedSubStringValue("Title","13"))
oBar.SetNamedSubStringValue("CountryId", "1")
oBar.SetNamedSubStringValue("BookName", lc_Title)

*Ln_PrintAmount is the number of labels printed
oBarPrint = oBar.PrintSetup
oBarPrint.IdenticalCopiesOfLabel = Ln_PrintAmount

*Printing
oBar.PrintOut(0,0)

*Quiting without saving
oBarCode.Quit(1)



Travi Spangle
Category Tools Category Code Samples Category Bar Codes
( Topic last updated: 2007.01.02 03:31:27 PM )