PrinterCodeTemplate.PrintMethod Property

ClosedDescription

Returns a reference to the PrintMethod object. Read-only.

ClosedSyntax

PrinterCodeTemplate.PrintMethod

ClosedRequirements

Version

BarTender 7.50 or higher

Edition

Automation, Enterprise Automation

ClosedRemarks

The PrinterCodeTemplate.PrintMethod property returns a reference to the document's PrintMethod object, which controls how the printer will print unsupported barcodes, boxes, and lines when it prints with the printer code template.

ClosedVB.NET Example

'Declare a BarTender application variable

Dim btApp As BarTender.Application

'Declare a BarTender document variable

Dim btFormat As BarTender.Format

'Declare a BarTender printer code template variable

Dim btPCT As BarTender.PrinterCodeTemplate

'Declare a BarTender print method variable

Dim btPrintMethod As BarTender.PrintMethod

'Declare a BarTender messages variable to hold all messages

Dim btMessages As BarTender.Messages = Nothing

'Create a new instance of BarTender

btApp = New BarTender.Application

'Set the BarTender application visible

btApp.Visible = True

'Open a BarTender document

btFormat = btApp.Formats.Open("c:\Format1.btw", False, "")

'Set the printer code template variable

btPCT = btFormat.PrinterCodeTemplate

'Select the print method variable

btPrintMethod = btPCT.PrintMethod

'Set the box print method option

btPrintMethod.Boxes = BarTender.BtBoxPrintMethod.btBoxAuto

'Export the printer code template

btPCT.Export("SAPscript-ITF", BarTender.BtPctExportType.btPctExportSeparate, "c:\Printer Code Templates\FormatTemplate.prn", "c:\Printer Code Templates\DataTemplate.prn", btMessages)

'End the BarTender process

btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)

ClosedC# Example

// Declare a BarTender application variable

BarTender.Application btApp;

// Declare a BarTender document variable

BarTender.Format btFormat;

// Declare a BarTender printer code template variable

BarTender.PrinterCodeTemplate btPCT;

// Declare a BarTender print method variable

BarTender.PrintMethod btPrintMethod;

// Declare a BarTender messages variable to hold all messages

BarTender.Messages btMessages;

// Declare an object variable

System.Object obj = null;

// Create a new instance of BarTender

btApp = new BarTender.Application();

// Set the BarTender application visible

btApp.Visible = true;

// Open a BarTender document

btFormat = btApp.Formats.Open("c:\\Format1.btw", false, "");

// Set the printer code template variable

btPCT = btFormat.PrinterCodeTemplate;

// Select the print method variable

btPrintMethod = btPCT.PrintMethod;

// Set the box print method option

btPrintMethod.Boxes = BarTender.BtBoxPrintMethod.btBoxAuto;

// Export the printer code template

btPCT.Export("SAPscript-ITF", BarTender.BtPctExportType.btPctExportSeparate, "c:\\Printer Code Templates\\FormatTemplate.prn", "c:\\Printer Code Templates\\DataTemplate.prn", ref obj);

// Set the messages variable to the object

btMessages = obj as BarTender.Messages;

// End the BarTender process

btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges);