Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4118970
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T23:01:50+00:00 2026-05-20T23:01:50+00:00

I am developing an C# application to print labels from a thermal transfer printer

  • 0

I am developing an C# application to print labels from a thermal transfer printer from SATO (CG408 TT)

For this I am using SBPL (Programming language for SATO). Which looks something like following:

<ESC>A
<ESC>H0050<ESC>V0100<ESC>L0303<ESC>XMSATO
<ESC>H0050<ESC>V0200<ESC>B103100*SATO*
<ESC>H0070<ESC>V0310<ESC>L0101<ESC>XUSATO
<ESC>Q1<ESC>Z

To communicate with Printer and send raw data to it I am following this technique. At first i am trying to build the escape sequences using StringBuilder Class.

StringBuilder sb = new StringBuilder();
              sb.AppendLine();
              sb.AppendLine("<ESC>A");
              sb.AppendLine("H0050<ESC>V0100<ESC>L0303<ESC>XMSATO");

and so on….

But how can I replace <ESC> part in string builder argument. I know that character 27, but then how to use it with AppendLine Command

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T23:01:51+00:00Added an answer on May 20, 2026 at 11:01 pm
    const char ESC = '\x1B';
    

    now you can use ESC like any other variable. Note that you can embed esc in a string as well: "\x1B" but I suppose that would become unwieldy (especially with adjacent numbers).

    Please do not ESC + "somestring" + ESC etc. because it defeats the purpose of the StringBuilder

    You could

    StringBuilder sb = new StringBuilder();
              sb.AppendLine();
              sb.AppendLine("<ESC>A");
              sb.AppendLine("H0050<ESC>V0100<ESC>L0303<ESC>XMSATO");
    String output = sb.ToString().Replace("<ESC>", "\x1B")
    

    e.g.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing an application which must print labels. The label printer i'm using is
I am developing a web application using Struts 1.2.7 I want to print a
I'm developing an application in c# using winforms and I need to print some
I developing an application in which i want to print the values on a
I am developing WTL GUI application. I want to print something on console. How
I am developing GL paint application. To paint any object, I am using UIView
I'm considering using memcached (at some point) in my application i'm currently developing. Eventually,
I'm developing application using backbone.js & jquery. I have following code in model: runReport:
I am developing a simple android application using eclipse. I wrote a JUnit TestCase
I am new in developing application for WinCE 5.0. I want to start from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.