Saltar al contenido principal

Búsqueda

Búsqueda

Retrieve Printer Names

Comentarios

3 comentarios

  • Avatar
    Ian Cummings
    Moderador
    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.
    0
  • Avatar
    Legacy Poster
    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.
    0
  • Avatar
    Ian Cummings
    Moderador
    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.

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

    ' 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.
    btEngine.Stop()
    End Using
    End Sub
    [/code]
    0

Iniciar sesión para dejar un comentario.