lsongdev / lsongdev/node-escpos

What is first bytes for first three commands

Open
#407 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.6k
Forks
443
PR merge metrics
No merged PRs in 30d

Description

I don't know TypeScript but I very need to develop print Image on StarTUP 900 printer.
I use .net/C# lang.
There is function from this project:
```
raster(image: Image, mode: RasterMode = 'NORMAL') {
if (!(image instanceof Image))
throw new TypeError('Only escpos.Image supported');
mode = utils.upperCase(mode);
if (mode === 'DHDW' ||
mode === 'DWH' ||
mode === 'DHW') mode = 'DWDH';
const raster = image.toRaster();
const header = _.GSV0_FORMAT[`GSV0_${mode}` as const];
this.buffer.write(header);
this.buffer.writeUInt16LE(raster.width);
this.buffer.writeUInt16LE(raster.height);
this.buffer.write(raster.data);
return this;
};
```
So, can anybody send me bytes for these three commands:
```
this.buffer.write(header);
this.buffer.writeUInt16LE(raster.width);
this.buffer.writeUInt16LE(raster.height);
```
???
In the case when Image has size 384x384 pixels

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the raster() entry point and the GSV0_FORMAT lookup shown in the issue. Trace how header, raster.width, and raster.height are encoded, then verify the resulting bytes for a 384x384 image against the printer protocol or existing tests. Done means documenting the three byte sequences clearly for the StarTUP 900 use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, nodejs, typescript
Domain
embedded-iot
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.