Zpl (zpl v0.3.0)
View SourceLocal, byte-oriented ZPL parsing and rendering through the Rust zpl crate.
Native operations return {:ok, value} or {:error, %Zpl.Error{}}. The bang
variants raise that error. Input must be a binary; strings are passed as UTF-8
bytes without implicitly selecting ^CI28. All rendering and output work runs
on BEAM dirty CPU schedulers.
Summary
Functions
All native compatibility flags disabled (the strict specification behavior).
The linked Rust renderer version.
Native defaults for a profile, including its independently selectable compatibility flags.
Native output resource budgets, independent of render budgets.
Frames the entire input losslessly, preserving unknown commands and binary data. Returns elements with byte offsets and final syntax. Framing is neither operand validation nor authorization to send commands to a printer.
Like parse/2, raising on failure.
Renders a complete binary into a document of scenes and warnings.
Like render/3, raising on failure.
Native render resource budgets.
Default byte-valued parser prefixes and delimiter.
Types
@type profile() :: :zd621 | :specification | :zq610_plus
@type result(value) :: {:ok, value} | {:error, Zpl.Error.t()}
Functions
@spec compatibility() :: map()
All native compatibility flags disabled (the strict specification behavior).
@spec library_version() :: String.t()
The linked Rust renderer version.
Native defaults for a profile, including its independently selectable compatibility flags.
@spec output_limits() :: map()
Native output resource budgets, independent of render budgets.
@spec parse(binary(), config()) :: result(Zpl.ParseResult.t())
Frames the entire input losslessly, preserving unknown commands and binary data. Returns elements with byte offsets and final syntax. Framing is neither operand validation nor authorization to send commands to a printer.
@spec parse!(binary(), config()) :: Zpl.ParseResult.t()
Like parse/2, raising on failure.
@spec render(binary(), config(), config()) :: result(Zpl.Document.t())
Renders a complete binary into a document of scenes and warnings.
Options accept :profile, :width, :height, :dpi, and :compatibility.
Compatibility overrides merge into the selected profile. Limits accept every
field of Rust's render::Limits. Unknown fields and invalid values fail.
@spec render!(binary(), config(), config()) :: Zpl.Document.t()
Like render/3, raising on failure.
@spec render_limits() :: map()
Native render resource budgets.
@spec syntax() :: map()
Default byte-valued parser prefixes and delimiter.