Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending print jobs through AWS Lambda #29

Open
emty12 opened this issue May 30, 2022 · 1 comment
Open

Sending print jobs through AWS Lambda #29

emty12 opened this issue May 30, 2022 · 1 comment

Comments

@emty12
Copy link

emty12 commented May 30, 2022

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

@receiptline
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants