zplCore.comzplCore.com

SnapshotDocument

public record SnapshotDocument

Semantic snapshot (name.approved.json next to the approved PNGs): resolution, label sizes and the elements with position and content, so a failing snapshot explains what changed ("text "FROM" moved 12 dots down", "barcode data changed") and not only how many pixels.

Constructors

SignatureDescription
# SnapshotDocument()

Properties

PropertyTypeDescription
Dpi { get; init; }intResolution of the render.
Engine { get; init; }stringzplCore version that wrote the snapshot.
Format { get; init; }stringFormat marker ("zplcore-snapshot").
Labels { get; init; }IReadOnlyList<SnapshotLabel>The labels with their elements.
SourceSha256 { get; init; }stringSHA-256 of the ZPL source (informational: the snapshot compares the render, not the source).
Version { get; init; }intFormat version (1).

Methods

Method SignatureReturnsDescription
static # FromJson(string json)SnapshotDocumentReads a snapshot document; null when the JSON is not one.
# ToJson()stringIndented JSON (camelCase).