Retrieve Printer Names Folgen

Legacy Poster

How can i get printers name through .net coding that i registered at bartender.
I want printer name dynamically and want to display it in dropdownlist

3 Kommentare

Ian Cummings
Aktionen für Kommentare Permalink

If you check the BarTender Help system under the Seagull.BarTender.Print namespace reference of the .NET component you'll see a Printer() class. Looking at the members of this class you'll see many properties such as print name, model etc of the currently selected printer for the currently loaded label format.
Legacy Poster
Aktionen für Kommentare Permalink

I want all printer names that i registered on SLS and want to display in dropdownlist
Printers class get only printers that are installed on local machine.
Ian Cummings
Aktionen für Kommentare Permalink

From the BarTender Help system.

When the Printers collection is instantiated, a list of available printers is added to the collection. The following example demonstrates how to enumerate a list of Printer objects, and use the default Printer.

Public Sub Demo()
' Initialize a new BarTender print engine.
Using btEngine As New Engine()
' Start the BarTender print engine.

' Get list of printers.
Dim btPrintersList As New Printers()

' Get the default printer.
Dim btPrinter As Printer = btPrintersList.Default

' Display the default printer information.
Console.WriteLine("Default Printer information:")
Console.WriteLine("Printer Name = " & btPrinter.PrinterName)
Console.WriteLine("Printer Model = " & btPrinter.PrinterModel)
Console.WriteLine("Printer Port = " & btPrinter.Port)
Console.WriteLine("Default Printer = " & btPrinter.IsDefault)

' Display information for all other printers.
Console.WriteLine("Other Printer information:")
For Each p As Printer In btPrintersList
If (Not p.Equals(btPrintersList.Default)) Then
Console.WriteLine("Printer Name = " & p.PrinterName)
Console.WriteLine("Printer Model = " & p.PrinterModel)
Console.WriteLine("Printer Port = " & p.Port)
Console.WriteLine("Default Printer = " & p.IsDefault)
End If
Next p

' Stop the BarTender print engine.
End Using
End Sub

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.