1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| Module Module1
Sub Main()
DymoSDK.App.Init()
Dim fullpath As String = System.IO.Path.GetFullPath("C:\Users\Moi\Desktop\Essai.dymo") 'samplelabel.dymo")
Dim dymoSDKLabel = DymoLabel.Instance
dymoSDKLabel.LoadLabelFromFilePath(fullpath)
Dim dymoSDKPrinter = DymoPrinter.Instance
Dim Printers = DymoPrinter.Instance.GetPrinters()
Dim ConnectedPrinter = Printers.FirstOrDefault()
For Each prt In Printers ' Iterate through each element and find a connected printer.
Console.WriteLine($"Printer info: {prt.DriverName}, {prt.Name}, {prt.IsTwinTurbo}")
If prt.IsConnected Then
ConnectedPrinter = prt
End If
Next
If dymoSDKPrinter.PrintLabel(dymoSDKLabel, ConnectedPrinter.Name, 1, False, False, 0, False, False) Then
Console.WriteLine("Print successful.")
End If
Console.ReadKey()
End Sub
End Module |
Partager