lsongdev / lsongdev/node-escpos
How to print the text from the next line, if the word extends the paper?
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 1.6k
- Fork
- 443
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I am working with the default example and its working fine. The only thing I have changed is that I have increased the length of english text to be printed.
device.open(function(){
printer
.font('a')
.align('ct')
.style('bu')
.size(1, 1)
.text('"The quick brown fox jumps over the lazy dog" is an English-language pangram—a sentence that contains all of the letters of the alphabet.')
.text('敏捷的棕色狐狸跳过懒狗')
.barcode('1234567', 'EAN8')
.table(["One", "Two", "Three"])
.tableCustom([
{ text:"Left", align:"LEFT", width:0.33 },
{ text:"Center", align:"CENTER", width:0.33},
{ text:"Right", align:"RIGHT", width:0.33 }
])
.qrimage('https://github.com/song940/node-escpos', function(err){
this.cut();
this.close();
});
});
Here is the photo of the print:

As you can see the words are broken on the right side if it extends the paper. My issue is with how the word breaks automatically to print the text. It seems like the css word-break property is at break-all mode.
Is there any way to change this behaviour so that instead of breaking the word, it will start printing from the next line?
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l’esempio predefinito e le chiamate concatenate a .text(...) mostrate nell’issue, riproducendo la lunga stringa in inglese sulla stampante di destinazione. Segui il percorso di stampa del testo per determinare come vengono gestite le righe che superano la larghezza della carta; il lavoro è completato quando le parole lunghe rimangono intatte e continuano sulla riga successiva invece di essere spezzate al bordo della carta.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- nodejs, typescript
- Ambito
- embedded-iot
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100