Show / Hide Table of Contents

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
System.Object
ZPLPrinter
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
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

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.

LabelBackColor

Gets or sets the label's background color in hex notation. Default it #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

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

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

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 it #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.

Methods

Dispose()

Releases all resources used by the ZPLPrinter.

Declaration
public void Dispose()
Implements
System.IDisposable.Dispose()

PowerOnReset()

Performs a power-on clearing the internal buffers for commands, fonts, and graphics.

Declaration
public void PowerOnReset()

ProcessCommands(Byte[])

Processes the ZPL commands contained into the specified array of bytes buffer.

Declaration
public List<byte[]> ProcessCommands(byte[] zplCommands)
Parameters
Type Name Description
System.Byte[] zplCommands

The array of bytes containing the ZPL commands to be processed.

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)

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)
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.

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)

Processes the ZPL commands contained into the specified string.

Declaration
public List<byte[]> ProcessCommands(string zplCommands)
Parameters
Type Name Description
System.String zplCommands

The string containing the ZPL commands to be processed.

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)

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)
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.

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)

Processes the ZPL commands contained into the specified file.

Declaration
public List<byte[]> ProcessCommandsFromFile(string filePath)
Parameters
Type Name Description
System.String filePath

The file path containing the ZPL commands to be processed.

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)

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)
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.

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.

Back to top Copyright © 2003- Neodynamic SRL
http://www.neodynamic.com