lsongdev / lsongdev/node-escpos

Generating a prn file without printer initialization

Open
#134 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hi.

Do you have an example which creates a prn file instead of printing it directly to the printer?

I have a printer installed on TP-Link TL-WR1043N/ND v1 router running on openwrt. Since the file system of the router is too low and ram is also low, it is not ideal for nodejs applications. I can successfully print simple text to the printer inside the router however I cannot print complex styles to it since I need a library for it.

To solve the problem, the router will request the server running either local or public to generate my complex styles and send the generated prn file to router and the router print it to the printer. (Note: network printers is not my ideal solution since routers are not running on the same network as the others)

Currenly, the design of your code doesn't allow me to do so since it is tightly coupled to the Printer Instance. Could you separate the formatting and the Printer instance?

I hope you will implement this since this is an amazing feature where you will generate the prn file and print it anytime.

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

The issue identifies the Printer instance and formatting as the affected areas, but provides no file or test paths. Begin by locating those components and define the requested generated-PRN flow separately from direct printing; done means a PRN file can be generated without printer initialization and the behavior is demonstrated or tested.

Written by the indexing model from the issue text.

Assessment

Tech stack
nodejs, typescript
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.