14Export to other formats & languages
RasterExport
Rendered bitmaps as PCX, multi-page TIFF (PackBits/CCITT), EPL2 graphic, Fingerprint, ESC/POS (raster image + cut) and PCL.
LabelLanguageWriter
The label model natively as EPL, Fingerprint, ESC/POS or PCL – text and barcodes remain printer commands.
var renderer = new ZplRenderer();
var results = renderer.Render(File.ReadAllText("labels.zpl"));
SKBitmap bmp = results[0].Bitmap;
File.WriteAllBytes("label.pcx", RasterExport.Pcx(bmp));
File.WriteAllBytes("labels.tif", RasterExport.Tiff(results.Select(r => r.Bitmap), TiffCompression.PackBits));
File.WriteAllBytes("label.epl", RasterExport.Epl(bmp)); // EPL2 GW graphic
File.WriteAllBytes("label.fp", RasterExport.Fingerprint(bmp)); // Honeywell/Intermec
File.WriteAllBytes("label.escpos", RasterExport.EscPos(bmp, cut: true));
File.WriteAllBytes("label.pcl", RasterExport.Pcl(bmp, dpi: 300));
// native commands from the label model (text stays text, barcodes stay barcodes)
string epl = LabelLanguageWriter.ToEpl(label);
string fingerprint = LabelLanguageWriter.ToFingerprint(label);
byte[] escpos = LabelLanguageWriter.ToEscPos(label);
byte[] pcl = LabelLanguageWriter.ToPcl(label);
Try it online on zplCloud.com: ZPL to EPL2 · ZPL to ESC/POS · ZPL to PCL
More on zplCloud.com: Blog: Print ZPL on any label printer
EPL and Fingerprint with records
With records, LabelLanguageWriter generates a stored EPL form (FS/FK) with variables and one data block per record, or Fingerprint with a copy count – mask counters included.
// label model + records natively as EPL2 or Fingerprint (text and barcodes stay commands)
string epl = LabelLanguageWriter.ToEpl(label, parcels, dpi: 203, copies: p => p.Parcels, formName: "VERSAND");
string fp = LabelLanguageWriter.ToFingerprint(label, parcels, dpi: 203, copies: p => p.Parcels);
File.WriteAllText("versand.epl", epl); // FS/FK form + variables, one data block per record
File.WriteAllText("versand.fp", fp);
TIFF, PCL, ESC/POS NV, GIF, HTML, EPS, mirroring & DPI conversion
TIFF with CCITT G3/G4, LZW, Deflate or PackBits and 1-bit, Gray8, RGB or RGBA; PCL monochrome/gray/color with mode 0/2/3; ESC/POS with NV graphics; GIF, SVG, HTML (embedded as PNG, GIF or SVG) and EPS (optionally as outlines). Outputs can be mirrored (Flip), set to landscape, scaled, made transparent and given DPI metadata. ZplGraphicEncoder converts images with dithering into ^GF (hex, ACS, Z64, B64 or automatically the shortest). ZplRescaler converts raw ZPL between resolutions: origins, label size, shapes, fonts, field blocks, ^BY, 2D module sizes and ^GF graphics.
var s = new ZplRenderSettings
{
OutputFormat = ZplOutputFormat.Tiff,
TiffCompression = TiffCompression.CcittGroup4, // None, CcittGroup3, Lzw, Deflate, PackBits
TiffPixelFormat = TiffPixelFormat.BlackWhite1, // Gray8, Rgb24, Rgba32
Flip = ZplFlip.X, PaperOrientation = ZplPaperOrientation.Landscape,
WriteDpiMetadata = true,
}.WithLabelSizeMm(100, 60);
byte[] tiff = new ZplRenderer(s).ProcessCommands(zpl)[0];
s.OutputFormat = ZplOutputFormat.Pcl; s.PclColorMode = PclColorMode.Grayscale; s.PclCompression = PclCompression.DeltaRow;
s.OutputFormat = ZplOutputFormat.Eps; s.EpsTextAsOutlines = true;
s.OutputFormat = ZplOutputFormat.Html; s.HtmlImageFormat = HtmlLabelImageFormat.Svg;
s.OutputFormat = ZplOutputFormat.Gif;
// ESC/POS: store the graphic once in NV memory, then just recall it
byte[] define = EscPosNv.DefineGraphic(photo, "G1"), print = EscPosNv.PrintGraphic("G1");
// image → ^GF with dithering and the shortest encoding
string gf = ZplGraphicEncoder.ToZpl(photo, GraphicCompression.Auto, DitherMode.FloydSteinberg, x: 20, y: 20);
// convert ZPL from 203 to 300 dpi (coordinates, fonts, ^BY, ^GF …)
string zpl300 = ZplRescaler.Rescale(zpl, 203, 300);
Try it online on zplCloud.com: Image to ZPL · ZPL DPI Converter
More on zplCloud.com: Guide: Graphics in ZPL (^GF)

