PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, September 15, 2022

[FIXED] How to print .txt file containing esc/pos commands using command prompt in windows?

 September 15, 2022     command, escpos, printing, windows     No comments   

Issue

I am trying to print ESC/pos commands from the .txt file using windows command prompt.

Let me explain what I tried so far:

I have connected my Epson Tm-m30 printer. Using a virtual port driver I can print the .txt file using the following command:

print /d:COM1 'file path'

Now my question: as it is, ESC/pos printer needs to print the ESC/pos commands like a paper cut, barcode printing, etc. When I paste the ESC/pos commands in the .txt file, it is print as it is, not as ESC/pos commands.

I am trying to print The following ESC/pos commands:

\x1B\x40
\x1D(k\x0d\x00\x30\x50\x30TEST PRINT
\x1D(k\x03\x00\x30\x51\x

But while printing it is printing it looks like above, not as ESC commands.

How do I print ESC/pos commands using a .txt file?


Solution

There are no commands built into Windows by default, so the following options are possible.

  • Use the tools distributed by EPSON
    Send Data Tool
    Issuing Receipts with Barcodes

  • Use a free tool published by someone somewhere

  • Create your own with a script tool such as PowerShell
    about_Special_Characters

  • Make your own with C++/C#/VB etc.
    Regex.Unescape(String) Method
    Regular Expression Language - Quick Reference

  • Create a file with binary data instead of text and copy it to COM1 with the copy /b command



Answered By - kunif
Answer Checked By - Pedro (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing