anastaciocintra / escpos-coffee

Java library for ESC/POS printer
https://anastaciocintra.github.io/escpos-coffee
MIT License
277 stars 72 forks source link

print "0" at all starts of line #79

Open fjalabert-orch opened 2 years ago

fjalabert-orch commented 2 years ago

I'm using a nixdorf TH210 printer and an epson one. 1) When I print on the epson using CP858, all is OK. When a print on the nixdorf, special chars like "é è" are KO. They works if I select Canadia french, not CP858 2) In all cases, I cannot print the euro symbol "€" 3) On the TH210 I also get a 0 at all start of lines (like a CR/LF issue..).

Desktop (please complete the following information):

Thank you. Regards.

fjalabert-orch commented 2 years ago

I've found part of the issue : the issue related to special chars is related on the code table that have not the same "int" value. So I've fixed this issue. But I still have the "0" at all start of line (or after each line first char)

Please help

anastaciocintra commented 2 years ago

hi @fjalabert-orch, take a look at https://github.com/anastaciocintra/escpos-coffee/wiki/Character-Code-Table I hope this can help

anastaciocintra commented 2 years ago

wow, sorry, you already made the diagnosis about code table.

now, about 0 at start of the line: Epson: your epson printer is printing ok, with no occurrences, isn't it?

Nixdorf: may be the nixdorf TH210 isn't 100% compatible. one possibility is to use https://github.com/anastaciocintra/escpos-coffee/wiki/Text-Styles#printmodestyle-plan-b its because PrintModeStyle is more simple than Style and works well with greater number of printers. complete code: https://github.com/anastaciocintra/escpos-coffee-samples/blob/master/usual/textprintmodestyle/src/main/java/TextPrintModeStyleSample.java

see you

anastaciocintra commented 2 years ago

I saw in https://www.dieboldnixdorf.com/-/media/diebold/ag-downloads/poslotterysystems/manuals/peripherals/thxxx/th210_programmersguidel_english.pdf

Select the emulation/software options sub-menu to set: x Printer Mode This function is used to set the printer emulation to Native, A794, A793 or Legacy emulation. x Printer ID mode This function is used to determine what printer ID value is returned in response to a Transmit printer ID command (1D 49 n) when the printer is in A794 emulation mode. The printer can be configured to send back the ID of the TH210, A794, A793 or Application Compatible Escape Command systems.

lot of information, but it is one possibility (configure emulation mode)

fjalabert-orch commented 2 years ago

now, about 0 at start of the line: Epson: your epson printer is printing ok, with no occurrences, isn't it?

Yes, with the Epson, all is OK. With the Nixdorf, all lines have it... somes lines with only an "\n" and no styling also. I've inspected the outputstream in the debug mode and all seems perfect.

I've tried to override or check if i'ts a CRLF because the "0" takes the style of the previous chars .... so that seems a "end off line char" that is printed à the beginning of the next line.

fjalabert-orch commented 2 years ago

lot of information, but it is one possibility (configure emulation mode)

I've seen that but no idea of how it works, and many tools of nixdor do not accept to install because do not detect any jdk and let me specify the location... :((

anastaciocintra commented 2 years ago

With the Nixdorf, all lines have it... somes lines with only an "\n" and no styling also. I've inspected the outputstream in the debug mode and all seems perfect.

In my humble opinion, you need another library or make one specific solution taking what matters from escpos-coffee , inheriting what works, and deploy your own solution.