public static void SendBytesToPrinter(string szPrinterName, byte[] pBytes) { var hPrinter = PrinterHelper.GetPrinter(szPrinterName); int dwWritten; if (!PrinterHelper.WritePrinter(hPrinter, pBytes, pBytes.Length, out dwWritten)) { BombWin32(); } PrinterHelper.EndPrinter(hPrinter); }
public void WriteData(byte[] data) { if (_hprinter != IntPtr.Zero) { int dwWritten; if (!PrinterHelper.WritePrinter(_hprinter, data, data.Length, out dwWritten)) { BombWin32(); } } }