NGT Reference

Envelope headers, visible tokens, and editable label bodies.

NGT files begin with ~0 or ~1 plus a six-digit payload length. The browser keeps the body editable, hides that envelope header in the editor, puts each [ESC] block on its own line, shows graphic payloads as Base64, and regenerates the header before saving or rendering.

Displayed

Visible token layer

The editor shows the body as readable text and converts invisible bytes into [ESC], [TER], [RET], [LF], [FF], [DEL], [TAB], and [0] so you can inspect the file without losing the raw meaning.

Rebuilt

Envelope regeneration

When the text changes, the app recalculates the ~0 or ~1 header from the current byte length and sends a valid .txt label to the renderer.

Core Structure

What a label file contains

Part Meaning Notes
~0 / ~1 Envelope Starts the file and selects the variant used by the printer stream.
000000 Payload length Six ASCII digits describing the byte length of the content after the header.
[ESC], [TER], [RET], [LF], [FF], [DEL], [TAB], [0] Visible control bytes These are the browser-friendly representations for non-printable bytes in the content body.
base64: Graphic payload The image body of graphic blocks is shown as Base64 so the raw bytes stay readable and can be reconstructed exactly.
F, S, D, Q Metadata segments Label name, speed, density, and quantity appear near the start of the stream.
#T, #B, L, G Renderable content Text, barcode, line or box, and graphics segments are parsed into the preview tree.

GS1 and EAN

Structured content segments

Label metadata, text, barcodes, line art, and graphics all ride inside the same NGT stream. The renderer only needs the body to be valid and the header length to match the current bytes.

Editing

Recommended workflow

[ESC] = Escape byte
[TER] = Terminator
[RET] = Carriage return
[LF]  = Line feed
[FF]  = Form feed
base64: = graphic payload

Open one of the bundled .txt examples, edit the visible tokens, and let the viewer rebuild the raw file before rendering. If you need the exact bytes, copy or export them from the app.

Example Files

Bundled label samples

The gallery loads the example files from /samples so the preview, the editor, and the API all use the same content source.

NG8CM_300.txt
NG8Abnahme.txt
NG6Abnahme.txt
ng8im.txt