Portix.One

troubleshooting · esc-pos

Receipt Paper Cuts Too Early

By Portix.One Published
A receipt cut in the middle of its content before printing finished

Quick answer

Inspect the final byte stream and ensure exactly one cut command appears after all text, images, and barcodes. Confirm image or QR length calculations, await every asynchronous rendering step, and submit the receipt as one ordered job. Do not append content after a template-level cut command.

Diagnose it

  1. Reproduce with a short plain-text receipt.
  2. Capture the generated bytes in hexadecimal.
  3. Search for every cut command and record its offset.
  4. Remove sections until the premature cut disappears.
  5. Check whether a reusable footer, library, or printer profile adds a cut.
  6. Verify binary payloads are not truncated by incorrect length fields.
  7. Ensure asynchronous image/QR generation finishes before finalization.

Frequent causes

  • Both the template and transport append a cut.
  • An embedded binary sequence is malformed and changes command parsing.
  • Multiple chunks are submitted as independent jobs, each auto-cutting.
  • A driver or printer preference cuts at document boundaries.
  • The application closes the job before later content is ready.

Correct pattern

Build an immutable command buffer, append feed lines required by the device, append one documented full or partial cut, then submit once with an idempotent job ID.

Verify

Test receipts with and without images, QR codes, long text, and maximum-width content. Confirm one cut after the final line across repeated and concurrent jobs.

Related content