Pass Printer as MemoryStream via LlSetPrinterInPrinterStream

Valid from List & Label 23
With the following code snippet you pass a printer as MemoryStream via LlSetPrinterInPrinterStream.

using combit.ListLabel23;
using System.IO;
using System.Drawing.Printing;
    //Pass report "test.lst" as stream
    MemoryStream myReport = new MemoryStream();
    using (FileStream file = new FileStream("test.lst", FileMode.Open, FileAccess.Read))
    //Create PrinterSettings (PrinterName)
    PrinterSettings myPrinterSettings = new PrinterSettings();
    myPrinterSettings.PrinterName = @"<PrinterName>";
    MemoryStream myPrinterStream = new MemoryStream();
    //Set PrinterName in PrinterStream
    LL.Core.LlSetPrinterInPrinterStream(LlProject.List, myPrinterSettings, myPrinterStream);
    //Suppress print options dialog
    LL.AutoShowPrintOptions = false;
    //Start print
    LL.Print(LlProject.List, myReport , myPrinterStream);


Imports combit.ListLabel23
Imports System.IO
Imports System.Drawing.Printing
   'Pass report "test.lst" as stream
    Dim myReport As New MemoryStream()
    Using file As FileStream = New FileStream("test.lst", FileMode.Open, FileAccess.Read)
    End Using
    'Create PrinterSettings (PrinterName)
    Dim myPrinterSettings As New PrinterSettings()
    myPrinterSettings.PrinterName = "<PrinterName>"
    Dim myPrinterStream As New MemoryStream()
    'Set PrinterName in PrinterStream
    LL.Core.LlSetPrinterInPrinterStream(LlProject.List, myPrinterSettings, myPrinterStream)
    'Suppress print options dialog
    LL.AutoShowPrintOptions = False
    'Start print
    LL.Print(LlProject.List, myReport, myPrinterStream)
IDKBTE001362 KBTE001362