Closed mic7010 closed 2 years ago
@mic7010 If the text data is more than the label width, it will automatically be printed on the next line. Each printer has a specific number of characters that can be printed, so please let us know the model name of the printer you want to print.
The model is the sm-l300. I did a test with a long description which was not wrapped. Can you provide a code snippet? Also, can I set a max lines to print?
I have printed a 50 character text as shown below and confirmed that it wraps at the 49th character as shown in the picture.
var builder = new StarXpandCommand.StarXpandCommandBuilder();
builder.addDocument(new StarXpandCommand.DocumentBuilder()
.addPrinter(new StarXpandCommand.PrinterBuilder()
.actionPrintText("12345678901234567890123456789012345678901234567890\n")
.actionCut(StarXpandCommand.Printer.CutType.Partial)
)
);
var commands = await builder.getCommands();
await printer.open();
await printer.print(commands);
Although not in terms of the number of characters, you can also specify the print area in millimeters by settingPrintableArea method.
The following is an example of setting the width to 48mm.
var builder = new StarXpandCommand.StarXpandCommandBuilder();
builder.addDocument(new StarXpandCommand.DocumentBuilder()
.settingPrintableArea(48)
.addPrinter(new StarXpandCommand.PrinterBuilder()
.actionPrintText("12345678901234567890123456789012345678901234567890\n")
.actionCut(StarXpandCommand.Printer.CutType.Partial)
)
);
Setting the width is not at all an answer to this question. It does not help in any way to avoid breaking words. If there is no way to avoid word breaking, please confirm by letting us know there is no way to avoid it. If there's a way, please advise.
@kickbk Star printers always break mid character if you exceed the maximum characters per line; they do not word wrap.
All of our printers have two fonts, Font A and Font B. Using Font A, our 3" printers allow for 48 characters per line. Using Font B which is the smaller width font, you can get up to 64 characters per line.
Knowing how many characters per line your printer supports will help you avoid word breaks and any unintentional wrapping.
I'm going to lock this conversation since this issue has been closed for some time. Please open a new issue for your specific use case if you need more help on this topic.
How do I control printing descriptions that exceed the label width? Do you support wrapping or other methods?