[C#.Net] How to store a format on printer?


To save the format, you can save it to DRAM or Internal Flash using the Designer program.
I would like to use this function through a function call. Referring to the SDK provided by Zebra,
The only functions related to Format in ZebraPrinter Interface are PrintStoredFormat() and RetrieveFormatFromPrinter().
I want to Store a format on Printer.

What does 'file' in PrintUtil.StoreFile() mean?
I don't understand parameters mean
I am entering commands through a USB connection to the printer.

What does 'Connection string' mean?
What does 'remote Name'?

Steven Si
The StoreFile() is for

The StoreFile() is for regular files, not suitable for stored format. In your case, you want to store a format template file to the printer and call out this template file later. This process is called Stored Format (or Download Format) and Recall Format on the ZPL Programming Guide.

The Stored Format is usually generated from ZebraDesigner tool. It's a template file in ZPL. There are two flavors the template file and both flavors are in ZPL. One is called ZPL Template file, which can be called out by Recall Format in ZPL. The other flavor is called XML Template file, which can be called out be XML stream. The ZebraDesigner tool can generate the XML stream template or ZPL Recall template.

If you open the Stored Format (or Download Format) file, you would see the following command at the top of the file:




The ^DFR:MyTemplate.ZPL^FS specifies that MyTemplate.ZPL should be stored in R: drive, which is the DRAM. If you want to store the template in the flash, simply change the R: to E:. Because the whole stored format is in ZPL, you simply use Connection.Write() API to send the content of the stored format to the printer. The printer will take care where to place it based on the ^DF command in the content.

When you want to call out the stored format on the printer, you would use Connection.Write() API to send the content of the Recall Format (or XML stream) to the printer. If you open the Recall Format, for example, you would see the following commands on the top of the recall format.




The ^XFR:MyTemplate.ZPL^FS command in the recall format specifies the stored format (and its location) to be called out.

Regarding your last two questions;

1. Connection string - Can you clarify which API this "Connection string" is referring to?

2. remoteName - This is the destination filename (or new filename) for the file to be stored on the printer in StoreFile() API

Vote up!
Vote down!

Points: 0

You voted ‘up’

Topic locked