You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the industry I work on it is very common that ticket paper has a color brand stripe to the left side:
In order for the text not be placed over the stripe, some precautions should be taken.
My solution is to add a "margin" parameter ("-m") to receiptio, and then overwrite the "area" command accordingly:
consttransform=async(receiptmd,printer)=>{// ...// ...if(printer.leftMargin){printer.command=Object.assign({},typeofprinter.command==='object' ? printer.command : receiptline.commands[printer.command]);// overwrite area functionconsta=printer.command.area;printer.command.area=(left,width,right)=>a(left+printer.leftMargin,width,right-printer.leftMargin);}returnreceiptline.transform(receiptmd,printer);};
Also, the parameter cpl might need to be adjusted.
i.e. with a cpl of 48 and a leftMargin of 2, will give a total width of 50, forcing the wrapping of every line.
So, when cpl is not manually provided it should be adjusted: cpl = default - leftMargin
I'm unsure this should be part of the receiptline or the receiptio tool. My implementation is on receiptio, but it might also fit as a general parameter in receiptline.
It could also be extended to right margin, of course.
Regards,
The text was updated successfully, but these errors were encountered:
In our first meeting of the new year we discussed what the margin specification should be.
The first is the same as your solution, plus a proposal to add margin to ReceiptLine configurations as well.
The second is a proposal to reinstate the margin property, which was omitted when the ReceiptLine specification was developed.
We then decided to adopt the first proposal.
We thought that by considering the color stripe area of the ticket paper as a non-printable area, it would conform to the CPL definition in the ReceipLline specification.
The medium of paper or screen that outputs the image of ReceiptLine is called paper. The number of characters that can be printed in the horizontal direction of the paper is called characters per line (CPL).
Hi,
In the industry I work on it is very common that ticket paper has a color brand stripe to the left side:
In order for the text not be placed over the stripe, some precautions should be taken.
My solution is to add a "margin" parameter ("-m") to receiptio, and then overwrite the "area" command accordingly:
Also, the parameter
cpl
might need to be adjusted.i.e. with a
cpl
of 48 and aleftMargin
of 2, will give a total width of 50, forcing the wrapping of every line.So, when
cpl
is not manually provided it should be adjusted:cpl = default - leftMargin
I'm unsure this should be part of the receiptline or the receiptio tool. My implementation is on receiptio, but it might also fit as a general parameter in receiptline.
It could also be extended to right margin, of course.
Regards,
The text was updated successfully, but these errors were encountered: