/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package zebra.zpl;

import zpl.constant.ZebraFont;
import zpl.model.ZebraLabel;
import zpl.model.ZebraPrintException;
import zpl.model.element.ZebraBarCode128;
import zpl.model.element.ZebraQRBarCode;
import zpl.model.element.ZebraText;
import zpl.utils.ZebraUtils;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Desarrollo2
 */
public class ZebraZpl {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        ZebraZpl zebraZpl = new ZebraZpl();
        zebraZpl.test1();
    }

    public void test1() {
        ZebraLabel zebraLabel = new ZebraLabel(912, 912);
        zebraLabel.setDefaultZebraFont(ZebraFont.ZEBRA_ZERO);

        //zebraLabel.addElement(new ZebraBarCode128(85, 45, "0000000001240003", 40, 1, 3));
        zebraLabel.addElement(new ZebraBarCode128(85, 74, "0000000001240003", 40, 1, 3));

        //Add Code Bar 
        //zebraLabel.addElement(new ZebraQRBarCode(525, 200, "https://www.abcpagos.com/estampilla_norte_santander/admin/pages/valida.php?referencia=0000000001240003"));
        //zebraLabel.addElement(new ZebraBarCode128(450, 244, "0000000001240003", 40, 1, 3));

        //zebraLabel.addElement(new ZebraText(85, 257, "Realtech", 6));
        //zebraLabel.addElement(new ZebraText(85, 297, "Id: 8080", 6));

        //zebraLabel.addElement(new ZebraText(540, 298, "$", 6));
        //zebraLabel.addElement(new ZebraText(555, 298, "1000", 6));

        String text = zebraLabel.getZplCode();
        System.out.println(text);

        try {
            ZebraUtils.printZpl(zebraLabel, "192.168.0.217", 9100);
        } catch (ZebraPrintException ex) {
            Logger.getLogger(ZebraZpl.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}
