ramonlopes / jzebra

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

Second time print not working in single web page. #190

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Written below given code to print.
2.Provided action like "Print Receipt" button.
3.We prepared one bill & given print.It is working.
4.Then we prepared second bill & given print.It is not working.Java 7 SE 45 
crashed..

What is the expected output? What do you see instead?

Expected second bill print.Instead Java plugin crashed.

What version of the product are you using? On what operating system?

1.7.6 free version,Window7,Windows XP,Google Chrome

Please provide any additional information below.
Printer :EPSON

Code Snippet:

 useDefaultPrinter();
                    var applet = document.jzebra;
                    if (applet != null) {
                        // Send characters/raw commands to applet using "append"
                        // Hint:  Carriage Return = \r, New Line = \n, Escape Double Quotes= \"
                        applet.append("\x1B\x40"); // 1
                        applet.append("\x1B\x21\x08"); // 2
                        var DataToPrint = document.getElementById('<%=hdn_Content.ClientID %>').value;
                        applet.appendImage(getPath() + ImgPath, "ESCP");
                        while (!applet.isDoneAppending()) { } //wait for image to download to java
                        applet.append("\r\n");
                        applet.append(DataToPrint);
                        applet.append(" \r\n");
                        applet.append("\x1D\x56\x41"); // 4
                        applet.append("\x1B\x40"); // 5
                        //applet.append("\nP1,1\n");
                        applet.print();

Original issue reported on code.google.com by sridhar....@gmail.com on 28 Nov 2013 at 12:57

GoogleCodeExporter commented 8 years ago
We commented appending image functionality in receipt print.It is working 
fine.But we have to print image on receipt.

Original comment by sridhar....@gmail.com on 29 Nov 2013 at 4:39

GoogleCodeExporter commented 8 years ago
Download 1.7.8 and take a look at that approach for appendImage.  The while 
loop is most likely causing the crash and 1.7.8 has a much better approach at 
the appendImage snippet.

-Tres

Original comment by tres.fin...@gmail.com on 29 Nov 2013 at 5:55

GoogleCodeExporter commented 8 years ago
Closing, marking as invalid.  Please reopen if you feel this was closed in 
error.

Original comment by tres.fin...@gmail.com on 5 Dec 2013 at 3:37