vikashsingh009 / jzebra

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

jzebra slows down/crashes the webpage #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This needs confirmation but I got the feeling that jzebra really slows things 
down, I had the chrome tab crashing also. It works fine otherwise.

Original issue reported on code.google.com by alexcp...@gmail.com on 20 Dec 2012 at 10:15

GoogleCodeExporter commented 9 years ago
Java is very taxing on the browser.  Furthermore, there are some while{} loops 
in the sample.html that will crash a web browser and the source code warns not 
to use them.  In order to track this bug better you must provide some more 
details about the issue.  If not, it will be closed for lack of information.

Original comment by tres.fin...@gmail.com on 21 Dec 2012 at 1:31

GoogleCodeExporter commented 9 years ago
It is specifically in the printPDF javascript function. There is a while loop ( 
while (!applet.isDoneFinding()) )

which goes on forever. I added a limit with an index but it would not find the 
printer if I do that.

Original comment by alexcp...@gmail.com on 21 Dec 2012 at 3:44

GoogleCodeExporter commented 9 years ago
Please see loading.html.  It has examples on how to do this properly allowing 
jZebra to call back when it's done downloading the PDF.  The sample that you 
are using has multiple warnings in it to not use while loops.

I believe the function you will implement is jzebraDoneAppending().

It can take a long time to download a pdf to java and the while loop can 
deadlock the browser during this time.

Alternatively, you can use setTimeout(), which there are some samples of in 
monitorAppending(), etc.

-Tres

Original comment by tres.fin...@gmail.com on 21 Dec 2012 at 5:12

GoogleCodeExporter commented 9 years ago

Original comment by tres.fin...@gmail.com on 21 Dec 2012 at 5:12

GoogleCodeExporter commented 9 years ago
I don't think the problem is the appending but when it tries to find the 
printer. I haven't looked at loading.html yet though.

Original comment by alexcp...@gmail.com on 21 Dec 2012 at 6:00

GoogleCodeExporter commented 9 years ago
Update: I just got what you meant, much better that way indeed.  :)

Original comment by alexcp...@gmail.com on 21 Dec 2012 at 6:29