We have a GX430t to which I would like to print over USB without using ZPL, EPL, etc.
Right now, we are using C# to print out rendered svg images (which include barcodes, text, etc.):
// userControl is a rendered svg var d = new PrintDialog { PrintQueue = _queue, PrintTicket = _validatedPrintTicket }; d.PrintVisual(userControl, "Print");
It would be really nice if we didn't have to treat the Zebra printer differently than other printers (or with some minimal changes).
Is there a way of making this method work with Zebras?
Or maybe there are other workarounds:
Could the image be written to an array and wrapped with ZPL to make it work?
Is there an easy way to convert SVG to something the printer will understand?
Are there other drivers for the Zebra that I am not seeing that would allow us to work with it in a more standard manner?
Any help or thoughts are appreciated!
Print without ZPL? |
1 Replies
Hi Nathan,
You should be able to use the driver the same as any other print driver. I do recommend installing the ZebraDesigner drivers. I have not tested if you can directly print an SVG, but you can convert an svg to a png or any standard singular image format. This would be the same for any print driver, so if you can do it with a standard printer, it should work with ours. Hope this makes sense.
The following code should print a png to any printer with a normal driver, including Zebra printers.
private System.Drawing.Printing.PrintDocument docToPrint = new System.Drawing.Printing.PrintDocument(); private System.Windows.Forms.PrintDialog printDialog1 = new System.Windows.Forms.PrintDialog(); private void button1_Click(object sender, EventArgs e) { try { docToPrint.PrintPage += document_PrintPage; // Set the Document property to the PrintDocument for // which the PrintPage Event has been handled. To display the // dialog, either this property or the PrinterSettings property // must be set printDialog1.Document = docToPrint; DialogResult result = printDialog1.ShowDialog(); // If the result is OK then print the document. if (result == DialogResult.OK) { docToPrint.Print(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } // The PrintPage event is raised for each page to be printed. private void document_PrintPage(object o, PrintPageEventArgs e) { string filepath = @"C:\My Documents\Pictures\Logo.png"; System.Drawing.Image img = System.Drawing.Image.FromFile(filepath); Point loc = new Point(100, 100); e.Graphics.DrawImage(img, loc); }Credits: PrintDialog Class (System.Windows.Forms) and Print images c#.net - Stack Overflow