POS for .Net print formatting - can't escape justfiy right

282 views Asked by At

i tried to use set text align right but when I trying above this code, I got that error.

var esc = (char)27;
var right = esc + "|rA";
//string right = Encoding.ASCII.GetString(new byte[] { 27, (byte)'|', (byte)'r', (byte)'A' });
foreach (ListViewItem item in listView_Sepet.Items)
{
   posPrinter.PrintNormal(PrinterStation.Slip, right + item.SubItems[1].Text + Environment.NewLine);
}

Here is error:

The input string was not in the correct format.

My Pos for .net version is 1.14.1

I tried two ways gave error.

First way

var esc = (char)27;
var right = esc + "|rA";

Second Way

string right = Encoding.ASCII.GetString(new byte[] { 27, (byte)'|', (byte)'r', (byte)'A' });
1

There are 1 answers

0
kunif On

It seems that there is no problem with how you use it on the specification.

However, support for these features depends on hardware and service object.
Even with no problem in specification, situations where hardware and service object do not support it often happen.

Please check the manual of the printer and service object(POS for.NET or OPOS) you are using.
Alternatively, if the service object supports the ValidateData method, you can check whether the corresponding function is supported depending on the result by calling the ValidateData method with the created print request string as a parameter.

If it is not supported, you need to edit the print layout in the application and then print it to POS for.NET.