But I am using an HP PCL 6 printer for testing purposes, so it may be caused by the printer not recognizing the commands. However, this prints the commands as text. WritePrinter(lhPrinter,PCL5Commands,PCL5Commands.Length, ref pcWritten) OpenPrinter(printerName, ref lhPrinter,0) System.IntPtr lhPrinter= new System.IntPtr() Public static void SendToPrinter( string jobName, string PCL5Commands, string printerName) ![]() Public static extern long ClosePrinter(IntPtr hPrinter) ![]() Public static extern long EndDocPrinter(IntPtr hPrinter) Public static extern long EndPagePrinter(IntPtr hPrinter) [ DllImport( "winspool.drv" ,CharSet=CharSet.Unicode,ExactSpelling= true , ![]() Public static extern long WritePrinter(IntPtr hPrinter, string data, [ DllImport( "winspool.drv",CharSet=CharSet.Ansi,ExactSpelling= true , Public static extern long StartPagePrinter(IntPtr hPrinter) Public static extern long StartDocPrinter(IntPtr hPrinter, Public static extern long OpenPrinter( string pPrinterName, ![]() Ref int pcchBuffer // size of name buffer StringBuilder pszBuffer, // printer name buffer Public static extern bool GetDefaultPrinter( I have attempted using the following code to produce the results: They want this to print directly to their printer. This text file contains commands that is used by their thermal printer, i.e.: I have a client that has a process which builds a text file.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |