You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NDC (NCR Direct Connect) is a binary protocol used by ATM terminals to format printer output. The `content` element with `format: ndc` parses these binary data streams into FlexRender elements. This is useful when rendering ATM receipt images from raw transaction data captured by banking middleware.
466
+
NDC (NCR Direct Connect) is a protocol used by ATM terminals to format printer output. The `content` element with `format: ndc` parses NDC data streams into FlexRender elements. This is useful when rendering ATM receipt images from raw transaction data captured by banking middleware.
467
467
468
468
The NDC parser requires `FlexRender.Content.Ndc` and `.WithNdc()` on the builder. A monospaced font (such as JetBrains Mono or Courier) is recommended for accurate column alignment.
469
469
470
-
**Template:**
470
+
The simplest approach is to reference the NDC data file directly in the template using `file:` source. NDC data files are typically `.bin` files containing escape sequences (`ESC` = `0x1B`) for charset switching, text formatting, and layout control.
471
+
472
+
**NDC data file** (`ndc-data/receipt.bin`):
473
+
474
+
The file contains raw NDC escape sequences. When viewed in a text editor, it looks like this (escape characters shown as `ESC`):
475
+
476
+
```
477
+
ESC(2 ESC(I г. москва, ESC(I ул. тестовая, д. 1, корп. 1 Б
> **Note:** NDC receipts use binary data (`BytesValue`), so they must be rendered through the C# API. The CLI does not support binary data inputs. For text-based NDC content, you can use `data:` URI format in the JSON data:
With the C# API, you can also pass NDC data dynamically via template variables (`source: "{{receiptData}}"`) using `BytesValue` for binary data or `StringValue` for text data.
566
+
567
+
> **Tip:** Use `flexrender debug-layout ndc-receipt.yaml` to visualize element boundaries and debug charset switching issues.
0 commit comments