2

I have issue with printing ITF bar code using escape characters. I have a .NET application that uses Pos for .NET and I cannot use 'PrintBarCode' method. My code looks like this:

public static void PrintBarCode()
    {
        var barCodeStr = ((char)29).ToString() + "k5123456" + ((char)0).ToString();
        var printer = new PosPrinter();
        printer.PrintNormal(PrinterStation.Receipt, barCodeStr);
    }

This chunk of code only prints "123456" and I cannot manage to make it print bar code.

3
  • .NET uses unicode strings, so this is probably not a good idea. Also, why do you think PosPrinter should work for your use case? And why are you using PrintNormal rather than PrintBarcode? Commented Jul 4, 2014 at 8:20
  • This is just an example. Of course there is extended usage of PosPrinter class (claim, enable, initialize.. etc). I need this because of prior implementation. We have huge string with esc characters that is printed in one transaction. It worked with previous requirements because barcode was printed last but now we have to but bar code in the middle of that transaction and we don't have much time rewriting it. It is design flaw but we need quick fix. Commented Jul 4, 2014 at 8:36
  • Couldn't you use TransactionPrint to batch the beginning text, barcode print, ending text into one print? Or rather, PageModePrint should allow you to use more than one PrintXXX on a single receipt. Commented Jul 4, 2014 at 8:46

1 Answer 1

2

i know this post is old, but hope it could help. Assuming you are using U/OPOS The problem is the escape sequence. As you can find on UnifiedPOS Version 1.14.1 -- October 23, 2014

the application can use the ESC|[*]#R escape sequence to print barcodes in-line with other print commands. The character ‘#’ is the number of characters following the R to use in the definition of the characteristics of the barcode to be printed.

The attribute symbols are defined as follows:
s symbology
h height
w width
a alignment
t human readable text position
d start of data
e end of sequence
The attributes MUST appear in the order specified in the above list.

An example is ESC|33Rs101h200w400a-2t-13d123456789012e
where ESC = in c# is :

char[] Escape = new char[1]{'\x1B'};
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for this it works! Except that cant get the width and height of the printed QR to change on epson T20 II. Were there any tricks you may remember to get the w and h to change?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.