Skip to content

[10] Port the ESC/POS parser and PDF ticket renderer #13

Description

@jvwaldrich0

Task 10 of 16 — these are sequential, do them in order.

Previous: #12 · Next: #14

Port target: cloudpark-toolkit (Go) → this repo (Rust). Reference paths below are relative to that repo.

Goal

Port the ESC/POS parser and the PDF ticket renderer. Tasks 12 and 13 both save tickets through it.

Scope

  • Parse the ESC/POS stream a VKP80III receives: text + codepage, alignment, font size/emphasis, line feeds, barcodes, QR codes, raster/bit-image blocks, cut.
  • Render the parsed ticket to a PDF page sized like the 80 mm roll and write it to the ticket dir with a timestamped filename.
  • Public API: printer::render_ticket(bytes: &[u8], ticket_dir: &Path) -> Result<PathBuf>.
  • Crates: printpdf (PDF) + image (raster blocks).

Reference

cloudpark-toolkit/internal/tcp105/printer/escpos.go (775 lines), printer.go, printer_test.go

Done when

  • A captured real ticket byte stream renders to a PDF with readable text and the barcode/QR present.
  • Unknown/unsupported ESC/POS sequences are skipped with a log line, never fatal.
  • Unit test over a small fixture stream.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions