Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Execute PCL Command (ESC X m nn) on Epson Thermal Printer using C# to increase Font Size

Status
Not open for further replies.

migz117

Programmer
Sep 16, 2021
1
0
0
PH
const char ESC = '\x1b';

// Initialize printer
sb.Append(ESC + "@"); <-- Working too

sb.Append(ESC + "E" + (char)1); <-- Bold Weight it Works too
// Align center
sb.Append(ESC + "a" + (char)1); <-- it works too

Select font by pitch and point: ESC X m nn <-- so i tried it on my code by doing this:

sb.Append(ESC + "X"+ (char)15); it did not work but there is no error on code.
sb.Append(ESC + "X"+ (int)15); also tried this still the same.

sb.AppendLine(" " + "HELLO WORLD!" + "\n");

output:

it was Bold
but the text is still normal size not bigger

how do i proper execute the ESC X m nn PCL Command
same as i had on the bold weight ESC A (char)1

please help my reference document are this one.

<-- Page 104 of the PDF Doc.
 
migz117 said:
Select font by pitch and point: ESC X m nn <-- so i tried it on my code by doing this:

sb.Append(ESC + "X"+ (char)15); it did not work but there is no error on code.
sb.Append(ESC + "X"+ (int)15); also tried this still the same.

It looks like the definition is requiring [Esc][X][m][nn]. But, you're only providing [m]. You'll need to provide the second character on there. Font pitch is [m] I assume. Font point size is [nn].

I've done some programming on label printers before. I always found it best for development and testing to edit what I want it to do in a test file. Send that test file to the printer to make sure it's working.

After that, I would code it into my programming language and save the output of what I would send to the printer to a file and do a difference comparison (sometimes in hexadecimal) to see if they were the same.

When they're the same, you know it will work.

--
Rick C. Hodgin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top