zplCore.comzplCore.com
class20 members

ZplResourceStore

public sealed class ZplResourceStore

Printer memory emulation: downloaded graphics (~DG, ~DY), stored formats (^DF) and fonts. Object names are case-insensitive; the drive letter (R:, E:, B:) is ignored.

Thread-safe: all members may be called concurrently, so one store can be shared by many renderers (e.g. one ZplRenderer per thread). Downloads from ZPL (~DG, ~DY, ~DU, ^DF) are limited by ZplResourceStore.MaxTotalBytes; objects added through the API are not.

Constructors

SignatureDescription
# ZplResourceStore()

Properties

PropertyTypeDescription
CacheGraphics { get; set; }boolCache decoded ^GF graphic data, so labels repeating the same graphic (logos in every format of a job) decode it only once (default off; bounded to ZplResourceStore.MaxCachedGraphics entries). Turning it off clears the cache.
CachedGraphicCount { get; }intNumber of decoded graphics currently cached.
Fonts { get; }FontManager
Formats { get; }IReadOnlyCollection<string>
Graphics { get; }IReadOnlyCollection<string>
MaxCachedGraphics { get; set; }intMaximum number of decoded graphics kept while ZplResourceStore.CacheGraphics is on (default 64).
MaxTotalBytes { get; set; }longQuota for objects downloaded by ZPL commands (~DG, ~DY, ~DU, ^DF), in bytes (default 256 MB, 0 = unlimited). Downloads that would exceed it are ignored, like a printer with full memory.
UsedBytes { get; }longApproximate memory used by stored graphics, formats and downloaded fonts in bytes.

Methods

Method SignatureReturnsDescription
# AddFormat(string name, IEnumerable<ZplCommand> commands)void
# AddGraphic(string name, MonoBitmap graphic)void
# AddGraphic(string name, SKBitmap image, bool dither = false)void
# Clear()voidClears all downloaded objects (like a printer power cycle).
# GetFormat(string name)List<ZplCommand>
# GetGraphic(string name)MonoBitmap
# RemoveFormat(string name)bool
# RemoveGraphic(string name)bool
# RenameFont(string name, string newName)boolRenames a downloaded/registered font (false when it doesn't exist or the new name is taken).
# RenameFormat(string name, string newName)boolRenames a stored format (false when it doesn't exist or the new name is taken).
# RenameGraphic(string name, string newName)boolRenames a stored graphic (false when it doesn't exist or the new name is taken).