lsongdev / lsongdev/node-escpos
Encode picture
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.6k
- Forks
- 443
- PR merge metrics
- No merged PRs in 30d
Description
Hi there. I have some troubles with printing images. Here my source code
`const device = new escpos.Network(IP);
const options = { encoding: 'CP860' };
const printer = new escpos.Printer(device, options);
const tux = path.join(__dirname, 'tux.png');
escpos.Image.load(tux, (image) => {
device.open(() => {
printer.text('hello here');
printer.image(image);
printer.cut();
printer.close();
});
});`
below I attached photo of result, thanks for your help)

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided escpos.Network, escpos.Image.load, and printer.image flow with the attached tux.png example and compare it with the linked photo. Trace how the image is loaded and sent to the printer; done means the image prints correctly rather than producing the reported output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- embedded-iot
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100