Print XML file to IP Printer

// Expert user has replied.
F Fernando Enciso Méndez 2 years 11 months ago
136 2 0

We have used the XMLPrinter class to print an external file, but we have problems because this class does not interpret XML well when it is converted to a byte array that is necessary for the use of the class.
The errors are: 1) Print the label with the name of the variables and not with the data. 2) when we convert the XML to a byte array as the XMLPrinter class says; The DOCTYPE line shows us an error in the execution, requesting a DTD file. now: we have removed the DOCTYPE line from the XML when we passed it to the byte array, but it doesn't work either.
The idea is to be able to send an XML file to the printer without it being processed in an application and to be able to use the previously saved printer template (ZPL). thanks we need a help.

Please register or login to post a reply

2 Replies

S Steven Si

Hi Fernando,
Are you referring to using XmlPrinter class? This class extracts the variable values from an XML input stream and re-packs the variable values in a ZPL Recall format to call out a ZPL Stored format on the printer in order to achieving the template printing. Basically, XmlPrinter class offers a ZPL template printing. This is different from a true XML template printing.
There are two types of template printing, ZPL template printing vs. XML template printing. The ZPL template printing is explained well in the Stored Format & Recall Format section in ZPL Programming Guide, which defines the Stored Format & Recall Format for ZPL. The XML template printing is documented in the Zebra XML-Enabled Printer Reference Guide, which defines the Stored Format & Recall Format for XML. Each template printing (ZPL vs XML) has its own Stored Format and Recall Format.
If you want to do a true XML template printing, you cannot use the XmlPrinter class. It won't work if we use XML Recall format to call out a ZPL stored format one the printer, or vice versa. 
Hope this helps.
Regards,

R Rabeb Othmani

Hello Fernando,
Could you please provide details regarding the printer you're using and the SDK version? 
Thank you 

CONTACT
Can’t find what you’re looking for?