receiptline / receiptio

A print application for receipt printers, simple and easy with markdown, printer status support.
Apache License 2.0
67 stars 10 forks source link

Question - API options for dots/cpl and spacing #3

Closed sabatale closed 2 years ago

sabatale commented 2 years ago

Great library! I'm personally only interested in generating digital receipts, without the need of the printer, through the API.

I wasn't sure which options actually allow to set the width and increase spacing, just like https://receiptline.github.io/designer/? Would that be done through character limitation only? Also, is there a way to set a specific font during render (e.g., <span style="font-family:Papyrus; font-size:4em;">Thanks!</span>)? I'm trying to make it look a bit more alike with the US & CA standard.

receiptline commented 2 years ago

Hello!

The option to set the width is -c <characters per line>.

The typical model, Epson TM-T88 series, has 42 characters per line. (resolution: 180 dpi) Some models for Asian languages and some models for mPOS may have 48 characters per line. (resolution: 203 dpi) The above values are for a paper width of 80 mm.

The option to adjust space is -s. (paper saving) By default, spacing is enabled.

To set a specific font, it is better to output in SVG and replace the font setting string. (or change the source code of lib/receiptline.js in the receiptline package) Traditional monospaced fonts (width : height = 1 : 2) are less common now, so it's hard to adjust.

Thank you!