I am printing a receipt with the following code:
Dim printFont As New System.Drawing.Font("Courier New", 10, System.Drawing.FontStyle.Regular)
e.Graphics.DrawString(sPrintText, printFont, System.Drawing.Brushes.Black, 10, 6)
sPrintText is a string I put together that looks like a basic receipt like this:
http://freeurl.ws/original.jpg
I then save the string to a txt file like this:
Dim f As New IO.StreamWriter(filename, False)
f.WriteLine(texttoprint)
When I open the file in notepad and print it, it comes out like this:
Anyone have any ideas on how I prevent this? I need it to reprint the same way the original did.
I had a similar problem using Star Impact Printer, spend over two days using all codes. At end resolve it by using RawPrinterHelper class available from Microsoft.
Here is the code which I have used to open the cash Drawer attached to the printer.
s = Chr(&H7);
RawPrinterHelper.SendStringToPrinter(receiptprinter, s);
You can substitute s for the full Receipt text. It should do graphics as well , but I have not tried it.