Zpl. Scene
(zpl v0.3.0)
View Source
An immutable rendered label with width, height, and DPI metadata.
The native reference owns the scene independently of the document's Elixir lifetime. Metadata fields are informational: editing them does not change the native scene. References are local to the VM and cannot be persisted or sent to another node. Output limits accept maps or keyword lists.
Summary
Functions
Encodes one label as a PNG, SVG, or PDF binary.
Rasterizes a label to raw grayscale bytes.
Types
@type t() :: %Zpl.Scene{ dpi: pos_integer(), height: pos_integer(), reference: reference(), width: pos_integer() }
Functions
@spec encode(t(), :png | :svg | :pdf, Zpl.config()) :: Zpl.result(binary())
Encodes one label as a PNG, SVG, or PDF binary.
@spec encode!(t(), :png | :svg | :pdf, Zpl.config()) :: binary()
@spec pdf(t(), Zpl.config()) :: Zpl.result(binary())
@spec png(t(), Zpl.config()) :: Zpl.result(binary())
@spec rasterize(t(), Zpl.config()) :: Zpl.result(Zpl.Raster.t())
Rasterizes a label to raw grayscale bytes.
@spec rasterize!(t(), Zpl.config()) :: Zpl.Raster.t()
@spec svg(t(), Zpl.config()) :: Zpl.result(binary())