Class ZPLPrinter
It represents a virtual printer emulator that can process ZPL (Zebra Programming Language) commands generating the output rendering in well known raster image and document formats like PNG, JPG, PDF and more.
Inheritance
Inherited Members
Namespace: Neodynamic.SDK.ZPLPrinter
Assembly: cs.temp.dll.dll
Syntax
public class ZPLPrinter : IDisposable
Constructors
ZPLPrinter(String, String)
Initializes a new instance of the ZPLPrinter class.
Declaration
public ZPLPrinter(string licenseOwner, string licenseKey)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | licenseOwner | The License Owner. |
| System.String | licenseKey | The License Key. |
Properties
AntiAlias
Gets or sets whether anti-aliasing rendering is enabled. Default is true;
Declaration
public bool AntiAlias { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
BackgroudImageBase64
Gets or sets the label's background image from a string in Base64 format. Image format mut be PNG or JPG.
Declaration
public string BackgroudImageBase64 { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
BackgroudImageBinary
Gets or sets the label's background image from a byte array buffer. Image format mut be PNG or JPG.
Declaration
public byte[] BackgroudImageBinary { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Byte[] |
BackgroudImageFile
Gets or sets the label's background image from a file path. Image format mut be PNG or JPG.
Declaration
public string BackgroudImageFile { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
BackgroudImageUrl
Gets or sets the label's background image from a URL. Image format mut be PNG or JPG.
Declaration
public string BackgroudImageUrl { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
CompressionQuality
Gets or sets the compression quality level to use for the output image. Values range from 0 to 100.
Declaration
public int CompressionQuality { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Description
Gets or sets the Description for this ZPLPrinter instance. Default is an empty string.
Declaration
public string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Dpi
Gets or sets the printer resolution in DPI (Dots per inch) value. Default is 203.
Declaration
public float Dpi { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Remarks
Real/physical printer devices are usually 152, 203, 300 or 600 dpi. The DPI value to be set must match the value for which the ZPL commands to be processed were created.
DrawRFID
Gets or sets whether a RFID image must be drawn on the label. Default is true.
Declaration
public bool DrawRFID { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
The RFID will be drawn if any supported RFID commands are found in the label.
EnableGraphicsCache
Gets or sets whether the ^GF commands output rendering should be cached or not. Default is false.
Declaration
public bool EnableGraphicsCache { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
EnablePngCompression
Gets or sets whether PNG compression is enabled. Default is true;
Declaration
public bool EnablePngCompression { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
EnablePrinting
Gets or sets whether the output rendering should be formatted for printing scenarios. Default is false.
Declaration
public bool EnablePrinting { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ForceLabelHeight
Gets or sets whether the LabelHeight property value must override the ^LL command. Default is false.
Declaration
public bool ForceLabelHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ForceLabelWidth
Gets or sets whether the LabelWidth property value must override the ^PW command. Default is false.
Declaration
public bool ForceLabelWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Formats
Gets the stored ZPL Formats.
Declaration
public Dictionary<string, ZPLFormat> Formats { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, ZPLFormat> |
Graphics
Gets the stored graphics.
Declaration
public Dictionary<string, ZPLCmdGF> Graphics { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, ZPLCmdGF> |
InvertColors
Gets or sets whether to invert the colors of the output image. Default is false.
Declaration
public bool InvertColors { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
LabelBackColor
Gets or sets the label's background color in hex notation. Default is #fff (White).
Declaration
public string LabelBackColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
The Color Hex notation is as follows #[AA]RRGGBB where A, R, G, B refers to Aplha, Red, Green and Blue pixels. The following options would also be valid: #RGB or #ARGB (in this short format all channel values must be the same), #RRGGBB or #AARRGGBB. Note: # is optional and can be omitted.
LabelHeight
Gets or sets the default label width in Dots units. Default is 1218 Dots which represents 6in at 203dpi.
Declaration
public float LabelHeight { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
LabelWidth
Gets or sets the default label width in Dots units. Default is 802 Dots which represents 4in at 203dpi.
Declaration
public float LabelWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Single |
Name
Gets or sets the Name for this ZPLPrinter instance. Default is an empty string.
Declaration
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
NonResidentFonts
Gets the non-resident fonts.
Declaration
public Dictionary<string, byte[]> NonResidentFonts { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.Dictionary<System.String, System.Byte[]> |
PdfMetadataAuthor
Gets or sets the PDF Metadata Author attribute.
Declaration
public string PdfMetadataAuthor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
PdfMetadataCreator
Gets or sets the PDF Metadata Creator attribute.
Declaration
public string PdfMetadataCreator { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
PdfMetadataProducer
Gets or sets the PDF Metadata Producer attribute.
Declaration
public string PdfMetadataProducer { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
PdfMetadataSubject
Gets or sets the PDF Metadata Subject attribute.
Declaration
public string PdfMetadataSubject { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
PdfMetadataTitle
Gets or sets the PDF Metadata Title attribute.
Declaration
public string PdfMetadataTitle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
RenderedElements
Gets the list of rendered ZPL elements based on the processed commands.
Declaration
public List<List<ZPLElement>> RenderedElements { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Collections.Generic.List<ZPLElement>> |
RenderedElementsAsJson
Gets the list of rendered ZPL elements based on the processed commands in JSON format.
Declaration
public string RenderedElementsAsJson { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
RenderOutputFormat
Gets or sets the image or document format for the output rendering process. Default is PNG.
Declaration
public RenderOutputFormat RenderOutputFormat { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderOutputFormat |
RenderOutputIndexes
Gets or sets the list of indexes which the rendered outputs must be filtered by. It must be a Zero-indexed list.
Declaration
public List<int> RenderOutputIndexes { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Int32> |
RenderOutputRotation
Gets or sets the rotation for the output rendering process. Default is None.
Declaration
public RenderOutputRotation RenderOutputRotation { get; set; }
Property Value
| Type | Description |
|---|---|
| RenderOutputRotation |
RibbonColor
Gets or sets the label's ribbon color in hex notation. Default is #000 (Black).
Declaration
public string RibbonColor { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
The Color Hex notation is as follows #[AA]RRGGBB where A, R, G, B refers to Aplha, Red, Green and Blue pixels. The following options would also be valid: #RGB or #ARGB (in this short format all channel values must be the same), #RRGGBB or #AARRGGBB. Note: # is optional and can be omitted.
RTC1
Gets the primary Real-Time Clock. The current date and time can be set to the Now subproperty.
Declaration
public RealTimeClock RTC1 { get; }
Property Value
| Type | Description |
|---|---|
| RealTimeClock |
RTC2
Gets the secondary Real-Time Clock. The current date and time can be set to the Now subproperty.
Declaration
public RealTimeClock RTC2 { get; }
Property Value
| Type | Description |
|---|---|
| RealTimeClock |
RTC3
Gets the tertiary Real-Time Clock. The current date and time can be set to the Now subproperty.
Declaration
public RealTimeClock RTC3 { get; }
Property Value
| Type | Description |
|---|---|
| RealTimeClock |
ThumbnailSize
Gets or sets the thumbnail size in pixel unit. Default is 0 (zero) which means thumbnail generation is disabled.
Declaration
public int ThumbnailSize { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
WatermarkImageBase64
Gets or sets the label's watermark image from a string in Base64 format. Image format mut be PNG or JPG.
Declaration
public string WatermarkImageBase64 { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
WatermarkImageBinary
Gets or sets the label's watermark image from a byte array buffer. Image format mut be PNG or JPG.
Declaration
public byte[] WatermarkImageBinary { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Byte[] |
WatermarkImageFile
Gets or sets the label's watermark image from a file path. Image format mut be PNG or JPG.
Declaration
public string WatermarkImageFile { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
WatermarkImageUrl
Gets or sets the label's watermark image from a URL. Image format mut be PNG or JPG.
Declaration
public string WatermarkImageUrl { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
WatermarkOpacity
Gets or sets the label's watermark image opacity level. Values range from 0 to 100.
Declaration
public int WatermarkOpacity { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
Methods
AddFont(String, Stream)
Adds a new font to the internal printer storage.
Declaration
public void AddFont(string fontName, Stream fontStream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fontName | The font name in the following format: [DRIVE:][NAME][.EXTENSION] [DRIVE:] The drive letter (R:, E:, B:, or A:). [NAME] The font name must be 1 to 8 alphanumeric characters. [.EXTENSION] The font extension must be set to |
| Stream | fontStream | The font stream. |
AddFont(String, Byte[])
Adds a new font to the internal printer storage.
Declaration
public void AddFont(string fontName, byte[] fontBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fontName | The font name in the following format: [DRIVE:][NAME][.EXTENSION] [DRIVE:] The drive letter (R:, E:, B:, or A:). [NAME] The font name must be 1 to 8 alphanumeric characters. [.EXTENSION] The font extension must be set to |
| System.Byte[] | fontBuffer | The byte array content of the font. |
AddFont(String, String)
Adds a new font to the internal printer storage.
Declaration
public void AddFont(string fontName, string fontFilePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fontName | The font name in the following format: [DRIVE:][NAME][.EXTENSION] [DRIVE:] The drive letter (R:, E:, B:, or A:). [NAME] The font name must be 1 to 8 alphanumeric characters. [.EXTENSION] The font extension must be set to |
| System.String | fontFilePath | The font file path. |
AddFormat(String, Stream)
Adds a new ZPL Format to the internal printer storage.
Declaration
public void AddFormat(string formatName, Stream formatStream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | formatName | The format name in the following format: [DRIVE:][NAME][.EXTENSION] [DRIVE:] The drive letter (R:, E:, B:, or A:). [NAME] The format name must be 1 to 8 alphanumeric characters. [.EXTENSION] The format extension must be set to |
| Stream | formatStream | The ZPL Format stream. |
AddFormat(String, Byte[])
Adds a new ZPL Format to the internal printer storage.
Declaration
public void AddFormat(string formatName, byte[] formatBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | formatName | The format name in the following format: [DRIVE:][NAME][.EXTENSION] [DRIVE:] The drive letter (R:, E:, B:, or A:). [NAME] The format name must be 1 to 8 alphanumeric characters. [.EXTENSION] The format extension must be set to |
| System.Byte[] | formatBuffer | The byte array content of the ZPL Format. |
AddFormat(String, String)
Adds a new ZPL Format to the internal printer storage.
Declaration
public void AddFormat(string formatName, string formatFilePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | formatName | The format name in the following format: [DRIVE:][NAME][.EXTENSION] [DRIVE:] The drive letter (R:, E:, B:, or A:). [NAME] The format name must be 1 to 8 alphanumeric characters. [.EXTENSION] The format extension must be set to |
| System.String | formatFilePath | The ZPL Format file path. |
AddGraphic(String, Stream)
Adds a new graphic to the internal printer storage.
Declaration
public void AddGraphic(string graphicName, Stream graphicStream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | graphicName | The graphic name in the following format: [DRIVE:][NAME][.EXTENSION] [DRIVE:] The drive letter (R:, E:, B:, or A:). [NAME] The graphic name must be 1 to 8 alphanumeric characters. [.EXTENSION] The graphic extension must be set to |
| Stream | graphicStream | The graphic stream. Supported image formats: PNG, JPG, GIF. |
AddGraphic(String, Byte[])
Adds a new graphic to the internal printer storage.
Declaration
public void AddGraphic(string graphicName, byte[] graphicBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | graphicName | The graphic name in the following format: [DRIVE:][NAME][.EXTENSION] [DRIVE:] The drive letter (R:, E:, B:, or A:). [NAME] The graphic name must be 1 to 8 alphanumeric characters. [.EXTENSION] The graphic extension must be set to |
| System.Byte[] | graphicBuffer | The byte array content of the graphic. Supported image formats: PNG, JPG, GIF. |
AddGraphic(String, String)
Adds a new graphic to the internal printer storage.
Declaration
public void AddGraphic(string graphicName, string graphicFilePath)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | graphicName | The graphic name in the following format: [DRIVE:][NAME][.EXTENSION] [DRIVE:] The drive letter (R:, E:, B:, or A:). [NAME] The graphic name must be 1 to 8 alphanumeric characters. [.EXTENSION] The graphic extension must be set to |
| System.String | graphicFilePath | The graphic file path. Supported image formats: PNG, JPG, GIF. |
Dispose()
Releases all resources used by the ZPLPrinter.
Declaration
public void Dispose()
Implements
FontExists(String)
Determines whether the specified font name exists in the internal printer storage.
Declaration
public bool FontExists(string fontName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fontName | The font name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the specified font name exists; otherwsie false. |
FormatExists(String)
Determines whether the specified ZPL Format name exists in the internal printer storage.
Declaration
public bool FormatExists(string formatName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | formatName | The format name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the specified font name exists; otherwsie false. |
FromJson(String)
Creates a ZPLPrinter from the specified JSON string.
Declaration
public static ZPLPrinter FromJson(string zplPrinterJson)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | zplPrinterJson | The JSON string representing a ZPLPrinter object. |
Returns
| Type | Description |
|---|---|
| ZPLPrinter | A ZPLPrinter object with the settings from the specified JSON string. |
GetFonts()
Gets the list of fonts available in the internal printer storage.
Declaration
public List<string> GetFonts()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | The list of fonts available in the internal printer storage. |
GetFormats()
Gets the list of ZPL Formats available in the internal printer storage.
Declaration
public List<string> GetFormats()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | The list of ZPL Formats available in the internal printer storage. |
GetGraphic(String)
Gets a buffer image (in PNG format) of the specified graphic name from the internal printer storage.
Declaration
public byte[] GetGraphic(string graphicName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | graphicName | The graphic name. |
Returns
| Type | Description |
|---|---|
| System.Byte[] | a buffer image (in PNG format) if the specified graphic name exists; otherwsie null. |
GetGraphics()
Gets the list of graphics available in the internal printer storage.
Declaration
public List<string> GetGraphics()
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.String> | The list of graphics available in the internal printer storage. |
GraphicExists(String)
Determines whether the specified graphic name exists in the internal printer storage.
Declaration
public bool GraphicExists(string graphicName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | graphicName | The graphic name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the specified graphic name exists; otherwsie false. |
OnPrinterControl(PrinterControlEventArgs)
Declaration
protected virtual void OnPrinterControl(PrinterControlEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| PrinterControlEventArgs | e |
OnRender(RenderEventArgs)
Declaration
protected virtual void OnRender(RenderEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderEventArgs | e |
PowerOnReset()
Performs a power-on clearing the internal buffers for commands, fonts, and graphics.
Declaration
public void PowerOnReset()
ProcessCommands(Byte[], Boolean)
Processes the ZPL commands contained into the specified array of bytes buffer.
Declaration
public List<byte[]> ProcessCommands(byte[] zplCommands, bool traceRenderedElements = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | zplCommands | The array of bytes containing the ZPL commands to be processed. |
| System.Boolean | traceRenderedElements | Whether to trace the ZPL elements rendered based on the ZPL commands to be processed. If true, the result will be available through the RenderedElements property. Default is false. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Byte[]> | Returns the output rendering process in the format specified to RenderOutputFormat property. |
Remarks
The array of bytes containing the ZPL commands is supposed to be encoded with CodePage or Encoding 850 (Latin Character Set).
The returned list of byte arrays will contain a single array if PDF format was specified or; one or more arrays for other formats like PNG, JPG or PCX. If more than one labels are rendered and if the output format is PDF, then a single multipage file is returned. For image formats, then the list will contain as many arrays as labels.
ProcessCommands(Byte[], Encoding, Boolean)
Processes the ZPL commands contained into the specified array of bytes buffer and using the specified Encoding or CodePage.
Declaration
public List<byte[]> ProcessCommands(byte[] zplCommands, Encoding textEncoding, bool traceRenderedElements = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Byte[] | zplCommands | The array of bytes containing the ZPL commands to be processed. |
| System.Text.Encoding | textEncoding | The Encoding or CodePage of the buffer content. |
| System.Boolean | traceRenderedElements | Whether to trace the ZPL elements rendered based on the ZPL commands to be processed. If true, the result will be available through the RenderedElements property. Default is false. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Byte[]> | Returns the output rendering process in the format specified to RenderOutputFormat property. |
Remarks
The returned list of byte arrays will contain a single array if PDF format was specified or; one or more arrays for other formats like PNG, JPG or PCX. If more than one labels are rendered and if the output format is PDF, then a single multipage file is returned. For image formats, then the list will contain as many arrays as labels.
ProcessCommands(String, Boolean)
Processes the ZPL commands contained into the specified string.
Declaration
public List<byte[]> ProcessCommands(string zplCommands, bool traceRenderedElements = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | zplCommands | The string containing the ZPL commands to be processed. |
| System.Boolean | traceRenderedElements | Whether to trace the ZPL elements rendered based on the ZPL commands to be processed. If true, the result will be available through the RenderedElements property. Default is false. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Byte[]> | Returns the output rendering process in the format specified to RenderOutputFormat property. |
Remarks
The string containing the ZPL commands is converted to an array of bytes prior processing it. That conversion will use CodePage or Encoding 850 (Latin Character Set).
The returned list of byte arrays will contain a single array if PDF format was specified or; one or more arrays for other formats like PNG, JPG or PCX. If more than one labels are rendered and if the output format is PDF, then a single multipage file is returned. For image formats, then the list will contain as many arrays as labels.
ProcessCommands(String, Encoding, Boolean)
Processes the ZPL commands contained into the specified string and using the specified Encoding or CodePage.
Declaration
public List<byte[]> ProcessCommands(string zplCommands, Encoding textEncoding, bool traceRenderedElements = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | zplCommands | The string containing the ZPL commands to be processed. |
| System.Text.Encoding | textEncoding | The Encoding or CodePage of the string content. |
| System.Boolean | traceRenderedElements | Whether to trace the ZPL elements rendered based on the ZPL commands to be processed. If true, the result will be available through the RenderedElements property. Default is false. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Byte[]> | Returns the output rendering process in the format specified to RenderOutputFormat property. |
Remarks
The returned list of byte arrays will contain a single array if PDF format was specified or; one or more arrays for other formats like PNG, JPG or PCX. If more than one labels are rendered and if the output format is PDF, then a single multipage file is returned. For image formats, then the list will contain as many arrays as labels.
ProcessCommandsFromFile(String, Boolean)
Processes the ZPL commands contained into the specified file.
Declaration
public List<byte[]> ProcessCommandsFromFile(string filePath, bool traceRenderedElements = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The file path containing the ZPL commands to be processed. |
| System.Boolean | traceRenderedElements | Whether to trace the ZPL elements rendered based on the ZPL commands to be processed. If true, the result will be available through the RenderedElements property. Default is false. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Byte[]> | Returns the output rendering process in the format specified to RenderOutputFormat property. |
Remarks
The default CodePage or encoding is 850 (Latin Character Set) but if the specified file has a UTF-8 BOM then UTF8 encoding will be used to process the file content.
The returned list of byte arrays will contain a single array if PDF format was specified or; one or more arrays for other formats like PNG, JPG or PCX. If more than one labels are rendered and if the output format is PDF, then a single multipage file is returned. For image formats, then the list will contain as many arrays as labels.
ProcessCommandsFromFile(String, Encoding, Boolean)
Processes the ZPL commands contained into the specified file and using the specified Encoding or CodePage.
Declaration
public List<byte[]> ProcessCommandsFromFile(string filePath, Encoding fileEncoding, bool traceRenderedElements = false)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | filePath | The file path containing the ZPL commands to be processed. |
| System.Text.Encoding | fileEncoding | The Encoding or CodePage of the file content. |
| System.Boolean | traceRenderedElements | Whether to trace the ZPL elements rendered based on the ZPL commands to be processed. If true, the result will be available through the RenderedElements property. Default is false. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Byte[]> | Returns the output rendering process in the format specified to RenderOutputFormat property. |
Remarks
The returned list of byte arrays will contain a single array if PDF format was specified or; one or more arrays for other formats like PNG, JPG or PCX. If more than one labels are rendered and if the output format is PDF, then a single multipage file is returned. For image formats, then the list will contain as many arrays as labels.
RemoveFont(String)
Removes the specified font name from the internal printer storage.
Declaration
public bool RemoveFont(string fontName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fontName | The font name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the font is successfully removed; otherwise false. |
RemoveFormat(String)
Removes the specified ZPL Format name from the internal printer storage.
Declaration
public bool RemoveFormat(string formatName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | formatName | The format name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the format is successfully removed; otherwise false. |
RemoveGraphic(String)
Removes the specified graphic name from the internal printer storage.
Declaration
public bool RemoveGraphic(string graphicName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | graphicName | The graphic name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the graphic is successfully removed; otherwise false. |
RenameFont(String, String)
Renames a current font name available in the internal printer storage to a new name.
Declaration
public bool RenameFont(string currentFontName, string newFontName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | currentFontName | The current font name. |
| System.String | newFontName | The new font name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the font is successfully renamed; otherwise false. |
RenameFormat(String, String)
Renames a current ZPL Format name available in the internal printer storage to a new name.
Declaration
public bool RenameFormat(string currentFormatName, string newFormatName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | currentFormatName | The current format name. |
| System.String | newFormatName | The new format name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the format is successfully renamed; otherwise false. |
RenameGraphic(String, String)
Renames a current graphic name available in the internal printer storage to a new name.
Declaration
public bool RenameGraphic(string currentGraphicName, string newGraphicName)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | currentGraphicName | The current graphic name. |
| System.String | newGraphicName | The new graphic name. |
Returns
| Type | Description |
|---|---|
| System.Boolean | true if the graphic is successfully renamed; otherwise false. |
ToJson()
Serializes this ZPLPrinter object to a JSON string.
Declaration
public string ToJson()
Returns
| Type | Description |
|---|---|
| System.String | A JSON string representing this ZPLPrinter object. |
Events
PrinterControl
Occurs when a printer control command is executed.
Declaration
public event PrinterControlEventHandler PrinterControl
Event Type
| Type | Description |
|---|---|
| PrinterControlEventHandler |
Render
Occurs when a rendering process in response to the specified printer commands is needed.
Declaration
public event RenderEventHandler Render
Event Type
| Type | Description |
|---|---|
| RenderEventHandler |
Remarks
The output of the rendering process is stored in the Buffer property of the RenderOutputEventArgs parameter. The format of such Buffer will depend on the value of the RenderOutputFormat property.