我正在使用 ionic 1 做一个移动应用程序,并且为了在热敏打印机上打印,我使用的是 cordova-plugin-datecs-printer 插件。
一切正常,除了自动换行。打印机在行尾剪切了单词。有没有办法调整或启用自动换行以避免不完整的单词?
这是我的代码:
tale += '{center}{b}Le Petit Prince{/b}{br}{br}';
tale += '{left}Once when I was six years old I saw a magnificent picture in a book, called True Stories from Nature, about the primeval forest. It was a picture of a boa constrictor in the act of swallowing an animal. Here is a copy of the drawing.&n the book it said: "Boa constrictors swallow their prey whole, without chewing it. After that they are not able to move, and they sleep through the six months that they need for digestion.';
//Replace & with line breaks
var text1 = tale.replace(/&/g, '{br}{br}');
cordovaPrinter.printText(text1);
这就是结果::(