Open "\\system2\EpsonLX-" For Output As #1
Print #1, Chr(27) & "@" 'Initialize printer
Print #1, Chr(27) & "A" & Chr(11)
Print #1, Chr(27) & "E" 'Set Font Bold
Print #1, "Printer is Bold"
Print #1, "Printer is Bold"
Print #1, Chr(27) & "F" ' Set Font Normal
Print #1, "Printer is Normal"
Print #1, "Printer is Normal"
Close #1
Is this kind of a printing is possible from C#.net please help
Loading
Mamta MPosted Oct 31, 2011, 8:13 AM
http://www.dragon-it.co.uk/links/epson_printer_codes.htm
VulpesPosted Oct 31, 2011, 8:06 AM
http://www.lprng.com/DISTRIB/RESOURCES/PPD/epson.htm
Nafihudheen KTPosted Oct 31, 2011, 7:43 AM
"TextWriter sw = new System.IO.StreamWriter("C:\\TempBill.txt");"
and print it using a batch file having code
type C:\TempBill.txt > \\system2\EpsonLx-
Ok its printing correctly and both in bold and normal form
the out put is just like this 'Printer is BoldPrinter is BoldPrinter is NormaPrinter is Normal'
Thanks to you ,
and if any one of you know the codes to change font size and style...etc just like the code Chr(27) & "E" Please tell me
Mamta MPosted Oct 31, 2011, 7:14 AM
http://devdump.wordpress.com/category/net/
And this too
http://www.pcreview.co.uk/forums/open-printer-file-handle-c-sharp-t3968052.html
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858%28v=vs.85%29.aspx
Nafihudheen KTPosted Oct 31, 2011, 7:01 AM
Yes Mamta M, as you are said the code aimed to print in dot matrix printer which is connected to a networked system (system2)
When I write the code you are provided in the line
"StreamWriter sw = new StreamWriter(@"\\system2\EpsonLX-");"
The following error shows,
"FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:', call CreateFile, then use the FileStream constructors that take an OS handle as an IntPtr."
Please tell me what to do now.
VulpesPosted Oct 31, 2011, 5:35 AM
sw.Close();
Mamta MPosted Oct 31, 2011, 5:01 AM
StreamWriter sw = new StreamWriter(@"\\system2\EpsonLX-");
sw.Write(Strings.Chr(27) + "@");
sw.Write(Strings.Chr(27) + "A" + Strings.Chr(11));
sw.Write(Strings.Chr(27) + "E");
sw.Write("Printer is Bold");
sw.Write("Printer is Bold");
sw.Write(Strings.Chr(27) + "F");
sw.Write("Printer is Normal");
sw.Write("Printer is Normal");
sw.Close();
But whether it works or not will have to be tested by you because I dont have that kind of a printer. Your code is aimed at a dot matrix printer I think.