receiptline / receiptline

Markdown for receipts. Printable digital receipts. Generate receipt printer commands and images.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sending print jobs through AWS Lambda

emty12 opened this issue · comments

Hello receiptline,
I have printer mC-Print2 and integration with it through AWS Lambda at node js
Here is the code

 const printer = {
            cpl: 42,
            encoding: 'cp865',
            upsideDown: true,
            spacing: true,
            command: 'starmbcs2'
        };

 res.status(200).type('application/vnd.star.starprntcore').send(Buffer.from(receiptline.transform(job, printer).slice(6), 'binary'));
 res.end()

here is the print job

{border: space; width: * 4 8}
-
|ITEM|QTY|AMOUNT|
-
Boiled salted peanuts | 1| 5.00
Tanashi cabbage with salted flavor | 1| 5.00
Shinshu lettuce salad | 1| 5.00
Ishigaki strawberry rolled cake | 1| 5.00
Peach juice from Date | 1| 5.00
-

I have tried few different config sets, but the result it's still not the best :(
With starmbcs2 it's somehow works, but not all of formatting

I've attached a photo with results

Can you please provide tips to print it correctly?
Thanks!

20220530_143745

Hello!
Thanks for using receiptline.

The correct value for "cpl" looks like 32.
The "command" should be starsbcs.

If you run the example en_star_cloudprnt.js on your local computer, does the printer work as expected?