how to do a print preview a CPCL print?

// Expert user has replied.
E Efkan YILMAZ 3 years 5 months ago
15 1 0

hi all i generate a label with this CPCL code:
C#
 
private void button1_Click(object sender, EventArgs e)
        {
            string ipAddress = "172.16.11.207";
            int port = 6101;
            port = 6101;
 
 
            // CPCL Command(s)
            string CPCLString = "! 0 200 200 580 ! UTILITIES" + Environment.NewLine + "BARCODE 128 .4 2 10 6 58 12345678" +
                               "FORM" + Environment.NewLine + "PRINT"+ Environment.NewLine;
            string CPCLString2 = "! 0 200 200 580 1" + Environment.NewLine + "! UTILITIES" +
                 Environment.NewLine + "BARCODE 128 4 2 10 6 58 12345678" + Environment.NewLine +
                               "FORM" + Environment.NewLine + "PRINT" + Environment.NewLine;
            try
            {
                // Open connection
                System.Net.Sockets.TcpClient client = new System.Net.Sockets.TcpClient();
                client.Connect(ipAddress, port);
 
 
                // Write CPCL String to connection
                System.IO.StreamWriter writer =
            new System.IO.StreamWriter(client.GetStream());
                writer.Write(CPCLString2);
                writer.Flush();
 
 
                // Close Connection
                writer.Close();
                client.Close();
            }
            catch (Exception ex)
            {
                // Catch Exception
            }
 
 
 
        }
 
always i need send the print Job to printer and see the result, but exist a way for see before print, and correct, and add labels codebars, etc?
 
Thanks

Please Register or Login to post a reply

1 Replies

M Manuel Caicedo-Rivera

Hi Miguel,

Unfortunately there is no way to see a print preview with CPCL language.

You could use ZebraDesigner tool to have an idea of the label design before to print, but you need to design the label graphically. ZebraDesigner does not import CPCL code.

Zebra supports CPCL language as a legacy language, but Zebra is not adding new features to it.

You could eventually see a print preview if you use the ZPL language, which is the recommended printer language by Zebra.

Thanks,

Manuel Caicedo

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