Show / Hide Table of Contents

Class EPLPrinter

It represents a virtual printer emulator that can process EPL (Eltron Programming Language) commands generating the output rendering in well known raster image and document formats like PNG, JPG, PDF and more.

Inheritance
System.Object
EPLPrinter
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.EPLPrinter
Assembly: cs.temp.dll.dll
Syntax
public class EPLPrinter : IDisposable

Constructors

EPLPrinter(String, String)

Initializes a new instance of the EPLPrinter class.

Declaration
public EPLPrinter(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 EPLPrinter 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 EPL commands to be processed were created.

EnablePrinting

Gets or sets whether the output rendering should be formatted for printing scenarios.

Declaration
public bool EnablePrinting { get; set; }
Property Value
Type Description
System.Boolean

ForceLabelHeight

Gets or sets whether the LabelHeight property value must override the Q 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 q command. Default is false.

Declaration
public bool ForceLabelWidth { get; set; }
Property Value
Type Description
System.Boolean

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 EPLPrinter 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

RenderedElements

Gets the list of rendered EPL elements based on the processed commands.

Declaration
public List<List<EPLElement>> RenderedElements { get; }
Property Value
Type Description
System.Collections.Generic.List<System.Collections.Generic.List<EPLElement>>

RenderedElementsAsJson

Gets the list of rendered EPL 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

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.

RTC

Gets the primary Real-Time Clock. The current date and time can be set to the Now subproperty.

Declaration
public RealTimeClock RTC { 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

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. It may be up to 8 characters long and it's case sensitive.

Stream graphicStream

The graphic stream. Supported image formats: PNG, JPG, GIF, PCX.

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. It may be up to 8 characters long and it's case sensitive.

System.Byte[] graphicBuffer

The byte array content of the graphic. Supported image formats: PNG, JPG, GIF, PCX.

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. It may be up to 8 characters long and it's case sensitive.

System.String graphicFilePath

The graphic file path. Supported image formats: PNG, JPG, GIF, PCX.

Dispose()

Releases all resources used by the EPLPrinter.

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

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.

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.

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 EPL commands contained into the specified array of bytes buffer.

Declaration
public List<byte[]> ProcessCommands(byte[] EPLCommands, bool traceRenderedElements = false)
Parameters
Type Name Description
System.Byte[] EPLCommands

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

System.Boolean traceRenderedElements

Whether to trace the EPL elements rendered based on the EPL 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 EPL 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 EPL commands contained into the specified array of bytes buffer and using the specified Encoding or CodePage.

Declaration
public List<byte[]> ProcessCommands(byte[] EPLCommands, Encoding textEncoding, bool traceRenderedElements = false)
Parameters
Type Name Description
System.Byte[] EPLCommands

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

System.Text.Encoding textEncoding

The Encoding or CodePage of the buffer content.

System.Boolean traceRenderedElements

Whether to trace the EPL elements rendered based on the EPL 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 EPL commands contained into the specified string.

Declaration
public List<byte[]> ProcessCommands(string EPLCommands, bool traceRenderedElements = false)
Parameters
Type Name Description
System.String EPLCommands

The string containing the EPL commands to be processed.

System.Boolean traceRenderedElements

Whether to trace the EPL elements rendered based on the EPL 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 EPL 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 EPL commands contained into the specified string and using the specified Encoding or CodePage.

Declaration
public List<byte[]> ProcessCommands(string EPLCommands, Encoding textEncoding, bool traceRenderedElements = false)
Parameters
Type Name Description
System.String EPLCommands

The string containing the EPL commands to be processed.

System.Text.Encoding textEncoding

The Encoding or CodePage of the string content.

System.Boolean traceRenderedElements

Whether to trace the EPL elements rendered based on the EPL 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 EPL 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 EPL commands to be processed.

System.Boolean traceRenderedElements

Whether to trace the EPL elements rendered based on the EPL 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 EPL 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 EPL commands to be processed.

System.Text.Encoding fileEncoding

The Encoding or CodePage of the file content.

System.Boolean traceRenderedElements

Whether to trace the EPL elements rendered based on the EPL 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.

Events

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.

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