Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Please excuse me if I am wrong because I am a beginner in searching for Command Codes.

I am using Espon LX300+ printer and am working with C#. I trying to print out a sales bill and I need Horizontal tab space to align columns. I am getting command codes like "ESC D n1 n2..NUL" but I am doing like this
C#
MyPrinter.Print("\x0e");
MyPrinter.Print(OdrDetails.deliverychannel );
MyPrinter.Print("\x14");

So how I convert ESC D like codes to this type.

What I have tried:

C#
MyPrinter.Print("\x0e");
MyPrinter.Print(OdrDetails.deliverychannel );
MyPrinter.Print("\x14");
MyPrinter.Print("    Del.Date : " + OdrDetails.deliverydate);
MyPrinter.Print("\r\n");
MyPrinter.Print("Slip#: "+OdrDetails.invno + "     " + OdrDetails.orderdate);
MyPrinter.Print("\r\n");
MyPrinter.Print("Customer: " + OdrDetails.cstname + "");
MyPrinter.Print("\r\n");
MyPrinter.Print("Add: " + OdrDetails.cstadd);
MyPrinter.Print("\x09");
MyPrinter.Print("\r\n");
MyPrinter.Print("123456.00");
Posted
Updated 19-Feb-18 8:55am
v2
Comments
CHill60 19-Feb-18 10:27am    
Try either "\\x09" or @"\x09" ?
Your problem is not very clear

1 solution

Tab size is based on the font family and size that you've selected, as well as kerning settings. Your only viable recourse is to establish your column widths ahead of time, and establish your X position on the page, and only print the portion of the field value that will fit within the already establish column width.

If it were me, I'd use a non-proportional font to make things easier on myself.
 
Share this answer
 

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