Zebra LinkOS Multiplatform SDK for Xamarin  1.1
Link-OS Portable Class Library Plugin for Xamarin
LinkOS.Plugin.ZebraPrinterImplementation Class Reference

The OS specific implementation of an IZebraPrinter More...

Inheritance diagram for LinkOS.Plugin.ZebraPrinterImplementation:
LinkOS.Plugin.Abstractions.IZebraPrinter LinkOS.Plugin.Abstractions.IGraphicsUtil LinkOS.Plugin.Abstractions.IFileUtil LinkOS.Plugin.Abstractions.IFormatUtil

Public Member Functions

IFieldDescription[] GetVariableFields (string formatString)
 Returns a list of descriptors of the variable fields in this format. More...
 
void PrintStoredFormat (string formatPathOnPrinter, string[] vars)
 Prints a stored format on the printer, filling in the fields specified by the array. The values of any format variables will be encoded using the default encoding type. See System.Text.Encoding for more information about encoding types. More...
 
void PrintStoredFormat (string formatPathOnPrinter, Dictionary< int, string > vars)
 Prints a stored format on the printer, filling in the fields specified by the Map. The values of any format variables will be encoded using the default encoding type. See System.Text.Encoding for more information about encoding types. More...
 
string[] RetrieveFileNames ()
 Retrieves the names of the files which are stored on the device. This function only works in Link-OS printers. ZebraLink printers may not properly respond to this command. Use: More...
 
string[] RetrieveFileNames (string[] extensions)
 Retrieves the names of the files which are stored on the device. This method only returns files which have one of the extensions in extensions. This function only works in Link-OS printers. ZebraLink printers may not properly respond to this command. Use: More...
 
byte[] RetrieveFormatFromPrinter (string formatPathOnPrinter)
 Retrieves a format from the printer. On a ZPL printer, only .ZPL files are supported. On a CPCL printer, only .FMT and .LBL files are supported. This function will only pull CPCL files on ZebraLink Mobile printers (RW, MZ, QL+). More...
 
void SendFileContents (string filePath)
 Sends the contents of a file to the device. More...
 
void PrintImage (string imageFilePath, int x, int y, int width=0, int height=0, bool insideFormat=false)
 Prints an image from the connecting device file system to the connected device as a monochrome image. Note: if the image resolution is large(e.g. 1024x768) this method may take a long time to execute or throw an OutOfMemoryError exception. More...
 
void StoreImage (string printerDriveAndFileName, string imageFilePath, int width, int height)
 Stores the specified image to the connected printer as a monochrome image. The image will be stored on the printer at printerDriveAndFileName with the extension GRF. If a drive letter is not supplied, E will be used as the default (e.g. FILE becomes E:FILE.GRF). If an extension is supplied, it is ignored (E:FILE.BMP becomes E:FILE.GRF). If the image resolution is large (e.g. 1024x768) this method may take a long time to execute or throw an OutOfMemoryError exception. More...
 
void PrintImage (object os_image, int x, int y, int width=0, int height=0, bool insideFormat=false)
 Prints an image from the connecting device system to the connected device as a monochrome image. Note: if the image resolution is large(e.g. 1024x768) this method may take a long time to execute or throw an OutOfMemoryError exception. More...
 
void StoreImage (string printerDriveAndFileName, object os_image, int width, int height)
 Stores the specified image to the connected printer as a monochrome image. The image will be stored on the printer at printerDriveAndFileName with the extension GRF. If a drive letter is not supplied, E will be used as the default (e.g. FILE becomes E:FILE.GRF). If an extension is supplied, it is ignored (E:FILE.BMP becomes E:FILE.GRF). If the image resolution is large (e.g. 1024x768) this method may take a long time to execute or throw an OutOfMemoryError exception. More...
 

Additional Inherited Members

Detailed Description

The OS specific implementation of an IZebraPrinter

Member Function Documentation

IFieldDescription [] LinkOS.Plugin.ZebraPrinterImplementation.GetVariableFields ( string  formatString)
inline

Returns a list of descriptors of the variable fields in this format.

Parameters
formatStringthe contents of the recalled format.
Returns
a list of field data descriptors. In CPCL the nth element of the list will contain the integer n and no name. In ZPL, each element will contain an ^FN number and a variable name if present. If the format contains multiple ^FNs with the same number, only the last one will be in the result. See IFieldDescription for an example of how variable fields look.

Implements LinkOS.Plugin.Abstractions.IFormatUtil.

void LinkOS.Plugin.ZebraPrinterImplementation.PrintImage ( string  imageFilePath,
int  x,
int  y,
int  width = 0,
int  height = 0,
bool  insideFormat = false 
)
inline

Prints an image from the connecting device file system to the connected device as a monochrome image. Note: if the image resolution is large(e.g. 1024x768) this method may take a long time to execute or throw an OutOfMemoryError exception.

Parameters
imageFilePathFull path to image file. (The image must be either a PNG or JPG).
xhorizontal starting position in dots.
yvertical starting position in dots.
widthdesired width of the printed image. Passing a value less than 1 will preserve original width.
heightdesired height of the printed image. Passing a value less than 1 will preserve original height.
insideFormatboolean value indicating whether this image should be printed by itself (false), or is part of a format being written to the connection (true).

Implements LinkOS.Plugin.Abstractions.IGraphicsUtil.

void LinkOS.Plugin.ZebraPrinterImplementation.PrintImage ( object  os_image,
int  x,
int  y,
int  width = 0,
int  height = 0,
bool  insideFormat = false 
)
inline

Prints an image from the connecting device system to the connected device as a monochrome image. Note: if the image resolution is large(e.g. 1024x768) this method may take a long time to execute or throw an OutOfMemoryError exception.

Parameters
os_imageIn Android - Android.Graphics.Bitmap image. In iOS - a CGImageRef image
xhorizontal starting position in dots.
yvertical starting position in dots.
widthdesired width of the printed image. Passing a value less than 1 will preserve original width.
heightdesired height of the printed image. Passing a value less than 1 will preserve original height.
insideFormatboolean value indicating whether this image should be printed by itself (false), or is part of a format being written to the connection (true).

Implements LinkOS.Plugin.Abstractions.IGraphicsUtil.

void LinkOS.Plugin.ZebraPrinterImplementation.PrintStoredFormat ( string  formatPathOnPrinter,
string[]  vars 
)
inline

Prints a stored format on the printer, filling in the fields specified by the array. The values of any format variables will be encoded using the default encoding type. See System.Text.Encoding for more information about encoding types.

Parameters
formatPathOnPrinterthe name of the format on the printer, including the extension (e.g. "E:FORMAT.ZPL").
varsan array of strings representing the data to fill into the format. For ZPL formats, index 0 of the array corresponds to field number 2 (^FN2). For CPCL, the variables are passed in the order that they are found in the format.

Implements LinkOS.Plugin.Abstractions.IFormatUtil.

void LinkOS.Plugin.ZebraPrinterImplementation.PrintStoredFormat ( string  formatPathOnPrinter,
Dictionary< int, string >  vars 
)
inline

Prints a stored format on the printer, filling in the fields specified by the Map. The values of any format variables will be encoded using the default encoding type. See System.Text.Encoding for more information about encoding types.

Parameters
formatPathOnPrinterthe location of the file on the printer (e.g. "E:FORMAT.ZPL").
varsa dictionary which contains the key/value pairs for the stored format. For ZPL formats, the key number should correspond directly to the number of the field in the format. For CPCL formats, the values will be passed in ascending numerical order.

Implements LinkOS.Plugin.Abstractions.IFormatUtil.

string [] LinkOS.Plugin.ZebraPrinterImplementation.RetrieveFileNames ( )
inline

Retrieves the names of the files which are stored on the device. This function only works in Link-OS printers. ZebraLink printers may not properly respond to this command. Use:

IConnection.SendAndWaitForResponse("! U1 getvar \"file.dir\"\r\n", 3000, 1000); or IConnection.SendAndWaitForResponse("^XA^HWE:*.*^XZ", 3000, 1000);

Returns
list of file names

Implements LinkOS.Plugin.Abstractions.IFileUtil.

string [] LinkOS.Plugin.ZebraPrinterImplementation.RetrieveFileNames ( string[]  extensions)
inline

Retrieves the names of the files which are stored on the device. This method only returns files which have one of the extensions in extensions. This function only works in Link-OS printers. ZebraLink printers may not properly respond to this command. Use:

IConnection.SendAndWaitForResponse("! U1 getvar \"file.dir\"\r\n", 3000, 1000); or IConnection.SendAndWaitForResponse("^XA^HWE:*." + extension + "^XZ", 3000, 1000);

Parameters
extensionsthe extensions to filter on
Returns
list of file names.

Implements LinkOS.Plugin.Abstractions.IFileUtil.

byte [] LinkOS.Plugin.ZebraPrinterImplementation.RetrieveFormatFromPrinter ( string  formatPathOnPrinter)
inline

Retrieves a format from the printer. On a ZPL printer, only .ZPL files are supported. On a CPCL printer, only .FMT and .LBL files are supported. This function will only pull CPCL files on ZebraLink Mobile printers (RW, MZ, QL+).

Parameters
formatPathOnPrinterthe location of the file on the printer (e.g. "E:FORMAT.ZPL").
Returns
the contents of the format file.

Implements LinkOS.Plugin.Abstractions.IFormatUtil.

void LinkOS.Plugin.ZebraPrinterImplementation.SendFileContents ( string  filePath)
inline

Sends the contents of a file to the device.

Parameters
filePaththe full file path (e.g. "/storage/sdcard1/Download/sample.lbl").

Implements LinkOS.Plugin.Abstractions.IFileUtil.

void LinkOS.Plugin.ZebraPrinterImplementation.StoreImage ( string  printerDriveAndFileName,
string  imageFilePath,
int  width,
int  height 
)
inline

Stores the specified image to the connected printer as a monochrome image. The image will be stored on the printer at printerDriveAndFileName with the extension GRF. If a drive letter is not supplied, E will be used as the default (e.g. FILE becomes E:FILE.GRF). If an extension is supplied, it is ignored (E:FILE.BMP becomes E:FILE.GRF). If the image resolution is large (e.g. 1024x768) this method may take a long time to execute or throw an OutOfMemoryError exception.

Parameters
printerDriveAndFileNamepath on the printer where the image will be stored.
imageFilePathFull path to image file. (The image must be either a PNG or JPG).
widthdesired width of the printed image, in dots. Passing -1 will preserve original width.
heightdesired height of the printed image, in dots. Passing -1 will preserve original height.

Implements LinkOS.Plugin.Abstractions.IGraphicsUtil.

void LinkOS.Plugin.ZebraPrinterImplementation.StoreImage ( string  printerDriveAndFileName,
object  os_image,
int  width,
int  height 
)
inline

Stores the specified image to the connected printer as a monochrome image. The image will be stored on the printer at printerDriveAndFileName with the extension GRF. If a drive letter is not supplied, E will be used as the default (e.g. FILE becomes E:FILE.GRF). If an extension is supplied, it is ignored (E:FILE.BMP becomes E:FILE.GRF). If the image resolution is large (e.g. 1024x768) this method may take a long time to execute or throw an OutOfMemoryError exception.

Parameters
printerDriveAndFileNamepath on the printer where the image will be stored.
os_imageIn Android - Android.Graphics.Bitmap image. In iOS - a CGImageRef image
widthdesired width of the printed image, in dots. Passing -1 will preserve original width.
heightdesired height of the printed image, in dots. Passing -1 will preserve original height.

Implements LinkOS.Plugin.Abstractions.IGraphicsUtil.


The documentation for this class was generated from the following file: