Format layout for Zebra printer printing

1

I was able to print to a Zebra RW 420 printer, but I do not know how to format the texts, I looked at the documentation to send the data to the printer, and I noticed the following:

                String cpclData = "! 0 200 200 210 1\r\n"
                        + "TEXT 4 0 30 40 This is a CPCL test.\r\n"
                        + "FORM\r\n"
                        + "PRINT\r\n";

This short excerpt makes the text larger, different font and bold, meant only to leave a margin of the text on the left and right side, as it is too much on the margin, and if possible, change the font and break a line, split a paragraph well.

Another thing I noticed, the print does not accept special characters, type ç Â Ã etc and seems to be ASC, am I correct?

I used ZebraDesigner2 and did the procedure to get this script and made my adaptation:

The DEFAULT:

! 0 200 200 406 1
PW 609
TONE 0
SPEED 3
ON-FEED IGNORE
NO-PACE
BAR-SENSE
PCX 40 102 
T 5 0 40 301 Negrito
T 5 0 40 240 Negrito
T 2 0 39 331 AUXILIAR 01
T 2 0 39 331 AUXILIAR 02
T 2 0 39 331 AUXILIAR 03
T 2 0 39 331 AUXILIAR 04
T 5 0 40 271 Negrito
T 5 0 40 62 Negrito
T 5 0 40 210 Negrito
T 5 0 40 32 Negrito
PRINT

And with my formatting:

                String texto = "! 0 200 200 406 1\r\n"
                        + "PW 609\r\n"
                        + "TONE 0\r\n"
                        + "SPEED 3\r\n"
                        + "ON-FEED IGNORE\r\n"
                        + "NO-PACE\r\n"
                        + "BAR-SENSE\r\n"
                        + "PCX 40 102\r\n"
                        + "T 5 0 40 301 " + notificacaoText.get(0) +"\r\n" //Negrito
                        + "T 5 0 40 240 " + notificacaoText.get(1) +"\r\n" //Negrito
                        + "T 2 0 39 331 " + notificacaoText.get(2) +"\r\n" //AUXILIAR
                        + "T 2 0 39 331 " + notificacaoText.get(3) +"\r\n" //AUXILIAR
                        + "T 2 0 39 331 " + notificacaoText.get(4) +"\r\n" //AUXILIAR
                        + "T 2 0 39 331 " + notificacaoText.get(5) +"\r\n" //AUXILIAR
                        + "T 2 0 39 331 " + notificacaoText.get(6) +"\r\n" //AUXILIAR
                        + "T 2 0 39 331 " + notificacaoText.get(7) +"\r\n" //AUXILIAR
                        + "T 5 0 40 271 " + notificacaoText.get(8) +"\r\n" //Negrito
                        + "T 5 0 40 62 " + notificacaoText.get(9) +"\r\n" //Negrito
                        + "T 5 0 40 210 " + notificacaoText.get(10) +"\r\n" //Negrito
                        + "T 5 0 40 32 " + notificacaoText.get(11) +"\r\n" //Negrito
                        + "PRINT\r\n";

However, the following error appears when trying to print:

  Could not find class 'com.zebra.sdk.util.internal.StringUtilities$1', referenced from method com.zebra.sdk.util.internal.StringUtilities.convertKeyValueJsonToMap
    
asked by anonymous 08.05.2015 / 14:20

1 answer

0

Resolved ... just switch to that:

                String texto = "! 0 200 200 406 1\r\n"
                        + "TEXT 5 0 40 301 " + notificacaoText.get(0) +"\r\n" //Negrito
                        + "TEXT 5 0 40 240 " + notificacaoText.get(1) +"\r\n" //Negrito
                        + "TEXT 2 0 39 331 " + notificacaoText.get(2) +"\r\n" //AUXILIAR
                        + "TEXT 2 0 39 332 " + notificacaoText.get(3) +"\r\n" //AUXILIAR
                        + "TEXT 2 0 39 333 " + notificacaoText.get(4) +"\r\n" //AUXILIAR
                        + "TEXT 2 0 39 334 " + notificacaoText.get(5) +"\r\n" //AUXILIAR
                        + "TEXT 2 0 39 335 " + notificacaoText.get(6) +"\r\n" //AUXILIAR
                        + "TEXT 2 0 39 336 " + notificacaoText.get(7) +"\r\n" //AUXILIAR
                        + "TEXT 5 0 40 271 " + notificacaoText.get(8) +"\r\n" //Negrito
                        + "TEXT 5 0 40 62 " + notificacaoText.get(9) +"\r\n" //Negrito
                        + "TEXT 5 0 40 210 " + notificacaoText.get(10) +"\r\n" //Negrito
                        + "TEXT 5 0 40 32 " + notificacaoText.get(11) +"\r\n" //Negrito
                        + "FORM\r\n"
                        + "PRINT\r\n";

However, each line has to be formatted for the paper, it can not exceed, for example, the 103mm of the sheet that I am using, in ZebraDesigner it shows the text in red when it exceeds this margin, each TEXT is a line if I put a paragraph in place of a well defined line, I will have problems ...

    
08.05.2015 / 19:35