daffaa08 / jzebra

Automatically exported from code.google.com/p/jzebra
0 stars 0 forks source link

multiple qz.append for multiple prints #210

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello 

I use Jzebra 1.71 to generate Datamatrix from PHP variables and ZPL language. 
My code is as follows:

<script type="text/javascript">
var qz;   // Our main applet
function print() {
 if (qz != null) {
            // Send characters/raw commands to qz using "append"
            // This example is for EPL.  Please adapt to your printer language
            // Hint:  Carriage Return = \r, New Line = \n, Escape Double Quotes= \"
            while (!qz.isDoneAppending()) {} //wait for image to download to java
qz.append("^XA^MMT^PW456^LL0406^LS0^FT30,405^BXN,5,200,0,0,5,_^FH^FD<?php echo 
$IdSte;?>^FS  ^FO20,20^ADN,18,10^FD<?php echo $IdSte;?>^FS 
^FO15,40^ADN,18,10^FD Date de peremption : <?php echo $peremption_sachet;?>^FS  
 ^FO15,60^ADN,18,10^FD Salle de sterilisation : <?php echo $salle_ste;?>^FS  
^FO15,80^ADN,18,10^FD Numero de la charge : <?php echo $numerocharge;?>^FS  
^PQ<?php echo $_POST['NombreImpressions'];?>,5,1,Y ^XZ");

qz.print();

        }

...
...
</script>

Everything works fine, but I would like to know how to generate more Datamatrix 
with the same script. 

I tried: 

----------------------------------------- 

qz.append ("xxxxxxx"); 
qz.append ("yyyyyyy"); 
qz.print (); 

---------------------------------------- 

There is only the qz.append party ("xxxxxxx") that is generated 

Same thing with 

----------------------------------------- 

qz.append ("xxxxxxx"); 
qz.print (); 
qz.append ("yyyyyyy"); 
qz.print (); 

----------------------------------------

Thanks You All !!!

Sorry for my bad english !!

Original issue reported on code.google.com by j.el...@mf-alsace.com on 25 Feb 2014 at 9:08

GoogleCodeExporter commented 9 years ago

// Append as many labels as you like
qz.append("^XA^MMT^...LABEL #1...^XZ");
qz.append("^XA^MMT^...LABEL #2...^XZ");
qz.append("^XA^MMT^...LABEL #3...^XZ");
qz.append("^XA^MMT^...LABEL #4...^XZ");
qz.append("^XA^MMT^...LABEL #5...^XZ");

// Optional, spools each label to the printer before printing the next label
qz.setEndOfDocument("^XZ");
qz.setDocumentsPerSpool("1");

// Print labels
qz.print();

Original comment by tres.fin...@gmail.com on 25 Feb 2014 at 9:16

GoogleCodeExporter commented 9 years ago
Does that answer your question?

Original comment by tres.fin...@gmail.com on 25 Feb 2014 at 9:17

GoogleCodeExporter commented 9 years ago
I try it tommorow and i tell you ;) thanks a lot !!!

Original comment by j.el...@mf-alsace.com on 25 Feb 2014 at 9:31

GoogleCodeExporter commented 9 years ago
Hi 

It's perfect !! Thank you !! 

Original comment by j.el...@mf-alsace.com on 26 Feb 2014 at 7:23

GoogleCodeExporter commented 9 years ago

Original comment by tres.fin...@gmail.com on 26 Feb 2014 at 3:23