receipt-print-hq / escpos-tools

Utilities to read ESC/POS print data
MIT License
201 stars 73 forks source link

I get a blank page when I execute my file ascii.bin with php esc2html.php ascii.bin > output.html #62

Closed zarafati closed 4 years ago

zarafati commented 5 years ago

I used: php esc2html.php ascii.bin > output.html to get a document html but as a result I've get a blank page with no text so what's the problem? the result that i've get: result

this is the file: ascii.txt

mike42 commented 5 years ago

I also get one character when I send this to a physical ESC/POS printer, so I'm not yet convinced there's an issue.

Would you mind sharing some more information about the type of printer that this document is intended for, and what it's supposed to look like?

$ hexdump -C ascii.txt 
00000000  1b 3d 01 1d 28 4a 02 00  01 00 1d 28 4a 02 00 02  |.=..(J.....(J...|
00000010  00 1d 28 4a 02 00 03 00  1b 63 30 02 1b 63 31 02  |..(J.....c0..c1.|
00000020  1b 63 33 00 1b 32 1b 52  00 1b 74 10 1d 62 01 1d  |.c3..2.R..t..b..|
00000030  50 00 00 1b 4a 00 1b 4a  c3 bf 1b 4a c2 93 1b 24  |P...J..J...J...$|
00000040  c2 88 00 1d 38 4c c2 b7  34 00 00 30 70 30 01 01  |....8L..4..0p0..|
00000050  31 c3 b8 00 c2 b3 01 00  00 00 00 00 00 00 00 00  |1...............|
00000060  00 00 00 00 00 00 00 00  00 00 00 00 00 00 c3 a0  |................|
00000070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000080  00 00 00 00 00 00 00 00  00 00 00 00 00 00 c3 a0  |................|
00000090  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 c3 a0  |................|
000000b0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000c0  01 c3 be 00 00 00 00 00  00 00 00 00 0e 00 00 00  |................|
000000d0  03 c2 80 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
000000e0  00 07 c3 bf 00 00 00 00  00 00 00 00 00 0e 00 00  |................|
000000f0  00 03 c2 80 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000100  00 00 07 03 00 00 00 00  00 00 00 00 00           |.............|
0000010d

Which is currently understood by esc2text as ..

$ php esc2text.php ascii.txt -v
[DEBUG] SelectPeripheralDeviceCmd 
[DEBUG] UnknownDataCmd 
[DEBUG] UnknownDataCmd 
[DEBUG] UnknownDataCmd 
[DEBUG] UnknownCommandOneArg 
[DEBUG] UnknownCommandOneArg 
[DEBUG] SelectPaperEndSensorsCmd 
[DEBUG] SelectDefaultLineSpacingCmd 
[DEBUG] SelectInternationalCharacterSetCmd 
[DEBUG] SelectCodeTableCmd 
[DEBUG] EnableSmoothingCmd 
[DEBUG] CommandTwoArgs 
[DEBUG] PrintAndFeedCmd (LineBreak)

[DEBUG] PrintAndFeedCmd (LineBreak)

[DEBUG] TextCmd (TextContainer)
┐[DEBUG] PrintAndFeedCmd (LineBreak)

[DEBUG] TextCmd (TextContainer)
ô[DEBUG] SetAbsolutePrintPosCmd 
[DEBUG] TextCmd (TextContainer)
[DEBUG] GraphicsLargeDataCmd 
zarafati commented 5 years ago

@mike42 for now i want just to get the conversion of this file into a HTML doc without using printer. but later i will use TM-T20II https://reference.epson-biz.com/modules/ref_escpos/index.php?content_id=331. And about what it's supposed to look like, I have no idea because I don't know the interpretation of the ESCPOS commands (maybe some text and images). that's why i asked you to check if the result that i've get is it true or not