zplCore.comzplCore.com

31Kommandozeile, Server-Image & Helm

tools/ZplCli ist als .NET-Tool packbar (Paket ZplCore.Cli, Befehl zplcore).

dotnet pack tools/ZplCli -c Release -o nupkg
dotnet tool install -g ZplCore.Cli --add-source nupkg

zplcore render label.zpl -o label.png --dpi 300 --width 100 --height 150   # mm; ein Bild pro Etikett
zplcore render label.zpl -o labels.pdf                                       # pdf/tiff/html enthalten alle Etiketten
zplcore render label.epl -f tiff -o out.tif                                  # EPL wird erkannt (oder --epl)
zplcore render label.zpl -f svg > label.svg                                  # stdout; "-" liest stdin
zplcore epl2zpl label.epl -o label.zpl
zplcore print label.zpl --host 192.168.1.50 --port 9100
zplcore barcode qrcode "https://example.com" -o qr.svg                       # png/svg/pdf/eps/jpeg/zpl
zplcore validate label.zpl                                                   # Exit-Code 1 bei Warnungen
zplcore format label.zpl -o pretty.zpl --comments                           # ein Befehl pro Zeile; --minify, --indent n
zplcore diff alt.zpl neu.zpl -o diff.png --boxes                             # Pixel-Overlay + Zeilen-Diff, Exit-Code 1 bei Unterschied
zplcore formats

zplcore comply label.zpl --pack gs1-logistic,sunrise                         # Compliance-Pre-Check (Text/JSON/SARIF)
zplcore verify label.zpl --fail-on mismatch,grade:C                          # Scan-Proof
zplcore check "labels/**/*.zpl" --verify --layout --format junit             # CI: alles in einem Lauf
zplcore import legacy.zpl -o label.json --report                             # ZPL → Label-Modell
zplcore extract label.zpl --format json · zplcore redact label.zpl -o out.zpl
zplcore gs1 migrate label.zpl -o label-2d.zpl · zplcore gs1 link "(01)…"
zplcore rfid encode --sscc 340123450000000017 --company-prefix 7 --format zpl
zplcore twin check label.zpl --profile ZD421d-203 · zplcore twin estimate …
zplcore serve --chaos chaos.json --cut-marks                                 # virtueller Drucker mit Störungen
zplcore lift label.pdf -o label.zpl --report                                 # PDF/SVG → natives ZPL

Weitere Optionen: --labels 0,2, --flip x|y|xy, --landscape, --no-antialias, --field n=Wert, --encoding. zplcore --help listet alle Befehle; Details zu den Prüfbefehlen in den Abschnitten Compliance bis Vector-Lift.

Server-Image (distroless), NativeAOT-Container, NAS & Helm-Chart

build/Dockerfile.server veröffentlicht samples/WebApiDemo auf mcr.microsoft.com/dotnet/aspnet:10.0-azurelinux3.0-distroless (oder aspnet:10.0-noble-chiseled-extra): keine Shell, Benutzer app (nicht root), Port 8080, /health, SQLite-Demodaten in /tmp – läuft mit --read-only. Für NativeAOT-Container ohne .NET-Laufzeit dient mcr.microsoft.com/dotnet/runtime-deps:10.0-noble-chiseled-extra als Basis (~79–105 MB Image-Größe). Damit wird selbst ein vorhandenes NAS (z. B. Synology DS923+ über den Synology Container Manager) oder ein Raspberry Pi im Handumdrehen zum lokalen Labelprint- und Rendering-Server im Lager (~90 MiB RAM, 67 ms PNG- und 113 ms PDF-Vorschau über LAN auf einer DS923+). deploy/helm/zplcore enthält Deployment, Service und HorizontalPodAutoscaler (Standard 2–10 Replikas, 70 % CPU), Probes auf /health, App-Einstellungen über env und ein schreibgeschütztes Root-Dateisystem mit emptyDir auf /tmp.

docker build -f build/Dockerfile.server -t zplcore-server .
docker run --rm --read-only --tmpfs /tmp -p 8080:8080 zplcore-server
curl -X POST 'localhost:8080/api/jobs/preview?format=pdf' -H 'Content-Type: application/json' \
     -d '{"data":[{"trackingNo":"00340000000000000014","name":"Anna Huber","city":"Wien","country":"AT"}]}' -o preview.pdf

helm install labels deploy/helm/zplcore --set image.repository=myregistry/zplcore-server --set image.tag=1.0.0