Beispiel #1
0
        public static bool SendByteArrayToPrinter(string szPrinterName, Byte[] bytes)
        {
            int    size   = Marshal.SizeOf(bytes[0]) * bytes.Length;
            IntPtr pBytes = Marshal.AllocHGlobal(size);

            Marshal.Copy(bytes, 0, pBytes, bytes.Length);

            RawPrinterHelper.SendBytesToPrinter(szPrinterName, pBytes, size);

            Marshal.FreeHGlobal(pBytes);

            return(true);
        }
Beispiel #2
0
 public void OpenDrawer()
 {
     Byte[] sequence = new Byte[1];
     sequence[0] = 0x1C;
     RawPrinterHelper.SendByteArrayToPrinter(this.printerName, sequence);
 }
Beispiel #3
0
 public void SendJob()
 {
     RawPrinterHelper.SendStringToPrinter(this.printerName, this.accumulatedText);
 }