ZPL example

Jul 19, 2013 at 4:25 PM
I'm trying to use the new patch adding ZPL support... I'm using a ZM400 right out of the box, with the default zpl driver (i've tried the ZPL an ZPLII setting on the control panel), printer is connected via USB and I'm using the SpoolPrinter object.. I've tried this kind of code, but altough I see that the printer receives some data, nothing is printed. When I call the ClearPrinter method the paper advances a bit, and that's all.

PrinterSettings ps = new PrinterSettings();
        ps.PrinterName = GetSelectedPrinterName();

        SpoolPrinter zm400 = new SpoolPrinter(ps);
        zm400.Print(ZPLCommands.TextWrite(0, 0, ElementDrawRotation.NO_ROTATION, 10, "helloworld"));
        zm400.Print(ZPLCommands.PrintBuffer(1));
        Barcode br = new Barcode();
        br.Type = BarcodeType.EAN13;

        zm400.Print(ZPLCommands.BarCodeWrite(0, 0, 50, ElementDrawRotation.NO_ROTATION, br, true, "1232132"));
        zm400.Print(ZPLCommands.ClearPrinter(ps));
        zm400.Print(ZPLCommands.TextWrite(0, 0, ElementDrawRotation.NO_ROTATION, 10, textBox1.Text));
        zm400.Print(ZPLCommands.PrintBuffer(1));


        zm400.Print(ZPLCommands.BarCodeWrite(0, 0, 50, ElementDrawRotation.NO_ROTATION, br, true, "1232132"));
        zm400.Print(ZPLCommands.PrintBuffer(1));