ZplJet 1.0.0

dotnet add package ZplJet --version 1.0.0
                    
NuGet\Install-Package ZplJet -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZplJet" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZplJet" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ZplJet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZplJet --version 1.0.0
                    
#r "nuget: ZplJet, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZplJet@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZplJet&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ZplJet&version=1.0.0
                    
Install as a Cake Tool

ZplJet

Official .NET SDK for the ZPLJet API — fast ZPL → PDF/PNG conversion.

NuGet CI license

  • Zero dependencies on modern .NET (a single System.Text.Json reference on netstandard2.0 only)
  • Fully documented — XML docs on every public member, typed results and exceptions
  • Reliable by default — automatic retries with exponential backoff (honoring Retry-After), per-attempt timeouts, CancellationToken support
  • Broad reach — targets net8.0 and netstandard2.0 (works on .NET Framework 4.7.2+, .NET 6/8/10, Unity, Mono)

Installation

dotnet add package ZplJet

Quickstart

Create an API key in the dashboard (keys look like zpl_…), then:

using ZplJet;

using var zpljet = new ZplJetClient(Environment.GetEnvironmentVariable("ZPLJET_API_KEY")!);

LabelData label = await zpljet.ConvertAsync(
    new ConvertRequest("^XA^FO50,50^A0N,50,50^FDHello^FS^XZ"));

await File.WriteAllBytesAsync("label.pdf", label.Data);

Keep your API key server-side. Anyone with the key can spend your quota. Create one ZplJetClient and reuse it — it is thread-safe and pools its HTTP connections.

Usage

Convert to PDF or PNG

Unset values use API defaults. Use ConvertToUrlAsync for hosted output.

LabelData label = await zpljet.ConvertAsync(new ConvertRequest(zpl)
{
    Format = LabelFormat.Png,
    Dpmm = Dpmm.D12,
    WidthMm = 101.6,
    HeightMm = 152.4,
});

label.Data;        // byte[] — the file
label.ContentType; // "application/pdf" | "image/png"
label.Id;          // conversion id (shows up in your dashboard)

Hosted URLs (paid plans)

ConvertToUrlAsync returns a hosted public link. Retention follows the account setting and plan limit.

HostedLabel hosted = await zpljet.ConvertToUrlAsync(new ConvertRequest(zpl));

hosted.Url;           // public URL to the PDF (works until the file is deleted)
hosted.Pages;         // pages rendered (one per ^XA…^XZ block)
hosted.RetentionDays; // how long the file is kept
hosted.ExpiresAt;     // when the file is deleted and the URL stops working (DateTimeOffset, UTC)

Error handling

Every API error code maps to a dedicated exception, so you branch with catch clauses — no string matching:

try
{
    LabelData label = await zpljet.ConvertAsync(new ConvertRequest(zpl));
}
catch (BadRequestException ex)
{
    Console.WriteLine($"Invalid request ({ex.Param}): {ex.Message}");
}
catch (QuotaExceededException ex)
{
    Console.WriteLine($"Quota used up ({ex.Used}/{ex.Quota}), resets {ex.ResetsAt}");
}
catch (RateLimitException ex)
{
    Console.WriteLine($"Rate limited — retry after {ex.RetryAfter}");
}
catch (ConversionFailedException ex)
{
    Console.WriteLine($"Engine rejected the ZPL (conversion {ex.ConversionId})");
}
catch (ApiConnectionException ex)
{
    Console.WriteLine($"Network problem: {ex.Message}");
}
Exception Status error.code Extra properties
BadRequestException 400 invalid_request Param
AuthenticationException 401 missing_api_key · invalid_api_key
QuotaExceededException 402 quota_exceeded Plan, Quota, Used, ResetsAt
PermissionDeniedException 403 hosting_not_allowed · no_retention_enforced
PayloadTooLargeException 413 payload_too_large
RateLimitException 429 rate_limit_exceeded RetryAfter, RetryAt
ConversionFailedException 502 conversion_failed ConversionId
ServiceUnavailableException 503 service_unavailable RetryAfter
ApiException any anything else Status, Code, Raw
ApiTimeoutException (an attempt timed out)
ApiConnectionException (request never got a response)

All of these extend ZplJetException, and every HTTP error carries Status, Code, DocUrl, and the raw error payload in Raw. Full code reference: zpljet.com/docs/errors.

Retries

Rate limits, transient 5xx responses, timeouts, and network failures retry up to twice by default. Retries use exponential backoff and honor Retry-After. conversion_failed is never retried.

Timeouts & cancellation

Each attempt has a 60-second timeout by default, and every method takes a CancellationToken:

using var zpljet = new ZplJetClient(new ZplJetClientOptions
{
    ApiKey = "zpl_…",
    BaseUrl = "https://api.zpljet.com",
    Timeout = TimeSpan.FromSeconds(10),
    MaxRetries = 5,
    HttpMessageHandler = myHandler,
});

using var cts = new CancellationTokenSource(TimeSpan.FromSeconds(5));
await zpljet.ConvertAsync(new ConvertRequest(zpl), cts.Token);

A timed-out attempt throws ApiTimeoutException (after retries); your own cancellation surfaces as OperationCanceledException and is never retried.

Examples

Runnable examples live in examples/:

ZPLJET_API_KEY=zpl_… dotnet run --project examples/ZplJet.Examples -- pdf

Contributing & development

dotnet build
dotnet test

ZPLJET_API_KEY=zpl_… dotnet test --filter Category=E2E

License

MIT

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 44 7/21/2026