Click here to Skip to main content
15,889,403 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Good day

I am currently trying to send raw data to my printer (Epson DFX-9000 dot matrix). Does anyone know the ESC sequences to print a barcode to this printer without using a barcode image?
i.e.
//Text place: 1=below 0=suppress

Convert.ToChar(20).ToString() + Convert.ToChar(20).ToString() + Convert.ToChar(73).ToString() + Convert.ToChar(0).ToString();
Posted
Updated 9-Mar-11 23:18pm
v4

Do you have any idea what you are trying to achieve?

Look at the spec for the bar code type you are trying to print as regards contrast and so forth, and then ask yourself: If I don't use an image on a dot-matrix printer, can I accurately get the relatives widths as required by the spec?

The answer is probably not.
Send an image, at least that has pixel-by-pixel control and a much higher chance of working...
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 10-Mar-11 3:48am    
Exactly, a 5.
--SA
[no name] 10-Mar-11 3:58am    
I have done this before for the seikosa printers.
Sergey Alexandrovich Kryukov 10-Mar-11 4:12am    
Who cares? You want to make yourself a work for the rest of your days? :-)
--SA
[no name] 10-Mar-11 4:06am    
The user manuals for BP-9000 documents exactly the asc values to use to create your barcode as raw data to send to the printer.
Sergey Alexandrovich Kryukov 10-Mar-11 4:13am    
If you have this document, why asking a Question here?
--SA
Here is the solution: This will print a 128 barcode through 3 multiple paper.
private void BarCode(string strBarcode, string strPrinter)
{
string BarcodeString = string.Empty;
List<string> PrintArray = new List<string>();

strBarcode = string.Format("{0}{1}", Convert.ToChar(65).ToString(), strBarcode);
//PrintArray.Add(string.Format("{0}{1}", Convert.ToChar(27).ToString(), Convert.ToChar(64).ToString())); // Reset Printer
BarcodeString = string.Format("{0}{1}{2}{3}{4}{5}{6}{7}{8}{9}{10}{11}", Convert.ToChar(27).ToString(),
Convert.ToChar(40).ToString(),
Convert.ToChar(66).ToString(),
Convert.ToChar(6 + strBarcode.Length).ToString(),
Convert.ToChar(0).ToString(),
Convert.ToChar(6).ToString(),
Convert.ToChar(2).ToString(),
Convert.ToChar(0).ToString(),
Convert.ToChar(36).ToString(),
Convert.ToChar(1).ToString(),
Convert.ToChar(1).ToString(),
strBarcode);

PrintArray.Add(BarcodeString);
PrintArray.Add(string.Format("{0}{1}", Convert.ToChar(10).ToString(), Convert.ToChar(13).ToString()));
PrintArray.Add(string.Format("{0}{1}", Convert.ToChar(27).ToString(), Convert.ToChar(64).ToString())); // Reset Printer
RawPrinterHelper.RawPrinterHelper.SendStringToPrinter(strPrinter, PrintArray);
}
 
Share this answer
 
v2
ASCII values? You certainly took a questionable root. What you need is normal graphical print well supported by .NET.

If you still want using proprietary stuff, ask Epson for support, read Epson documentation. The low-level printer codes are highly incompatible, specific to printers.

—SA
 
Share this answer
 
Comments
[no name] 10-Mar-11 4:04am    
I can not use a barcode image as the barcode is at times unscannable where with raw data I have not had this issue.
Sergey Alexandrovich Kryukov 10-Mar-11 4:11am    
This is not a valid reason. It does not make any difference at all. If it fail to scan print "scan failure" or whatever. When if fails, what would you print in low-level? I guess something to fool yourself...
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900