Tech Off Post

Single Post Permalink

View Thread: Problems with Chr(0)
  • User profile image

    figuerres said:
    jh71283 said:

    this looks like it works:

    StringBuilder Stb = new StringBuilder();
    Stb.Append("foo \x1b!\x00 Barf Gog.");
    String goog = Stb.ToString();

    try appending "\x00"  and see how that works.
    the above makes a string that does have all of the values. 

    I am at home so I can't try sending it to the printer right now.

    Hi figuerres.... yeah we discusses PosPrinters a little while back.

    Athough it is not actually an Epson printer,  all pos printers support ESC/Pos, although some have better support than others.

    The reason I hoped to use the ESC ! method is that some printers do not like it if I send them a sequence of escapes, Such as

    [FontA][Color Red][DoubleWidth]Hello blah blah
    [DoubleWidth][Color Red] Hello Again

    If you know what I mean....
    Some printers will accept the first Double for example, and print the first  line in Double, but the second [Double] seems to switch it back off!

    However, some other printers, will ONLY print the second line in double if it is specified on that line, otherwise they revert to single.

    From testing so far, the ESC "!" seems to work, but I Cannot select Font A (and Font B on some printers is MUCH smaller.)

    As I said before I wish I could just tell people to buy Epson printers exclusively, at least they stick to the standard!


    Thanks for the suggestion, but that is the situation I am trying to get out of for the reasons above.

    For example If I want Double Width, Font A the Esc ! code is

    ESC ! (32)

    Whereas otherwise I have to Build it such as

    ESC|0fT & ESC|2C

    Which as I said, some printers are happy with, but not all Sad