ShaigMammadov / jzebra

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

qzDoneAppending #223

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1.given this code:

html2canvas($("#sd-body-invoice"), {
  "useCORS": true,
  "allowTaint": true,
  "logging": true,
  "proxy": "html2canvasproxy.php",
  "onrendered": function(canvas) {
   var rp_printer = $('#sd-shipping_options_printer_sets_invoice').val();
   findPrinter(rp_printer,'sd-shipping_options_printer_sets_invoice');
   qz.append64(canvas.toDataURL('image/png'));
   window['qzDoneAppending'] = function() {

     qz.printPS();

   window['qzDoneAppending'] = null;
   };

  }
});

2. debugging under firefox. printer is found successfully.

3. qzDoneAppending is never called

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

I wanna print the html. nothing happens. when I debug it , qzDoneAppending is 
never called. it never gets to qz.printPS();

Additionally, No images is shown in the canvas, thought i used the proxy... 

What version of the product are you using? On what operating system?
both Windows and Mac.

Original issue reported on code.google.com by haimom...@gmail.com on 21 Aug 2014 at 3:29

GoogleCodeExporter commented 8 years ago
1. findPrinter() is asyncronous, you need to do that and wait for it to finish 
before any of the appending stuff.

2. HTML5 does not allow cross-domain origin images and that can cause problems.

3. You have parameters that aren't in the demo, and the demo works fine for me. 
 I have a hires barcode example I made last week I can send along that make use 
of pure HTML and doesn't rely on linked images.

4.  We are over on github now for bugs so that's a better place.  This bug 
tracker from google isn't very good and our source code isn't stored here 
either so it's much easier to create the bug reports directly on github.

https://github.com/qzindustries/qz-print/issues

Original comment by tres.fin...@gmail.com on 21 Aug 2014 at 8:07

GoogleCodeExporter commented 8 years ago
can you please send me that code?

Best regards, Haim

Original comment by haimom...@gmail.com on 24 Aug 2014 at 12:30

GoogleCodeExporter commented 8 years ago
Oh by the way ,when i run this code:

$("#content").html2canvas({ 
   canvas: hidden_screenshot,
   onrendered: function() {
   blah blah blah...
});

it fails to run the onrendered function. the console errors are:

GET http://html2canvas.appspot.com/ [HTTP/1.1 404 Not Found 66ms]
GET http://html2canvas.appspot.com/ [HTTP/1.1 404 Not Found 66ms]
GET http://html2canvas.appspot.com/ [HTTP/1.1 404 Not Found 66ms]

I guess that's for each photo the page holds. 

Please help

Original comment by haimom...@gmail.com on 24 Aug 2014 at 12:50

GoogleCodeExporter commented 8 years ago
The canvas element doesn't permit cross domain origin requests.  You will need 
to make the browser believe the page and the image originate from the same 
domain.

Email me Tres.Finocchiaro @gmail.com and I'll attach that demo I made.

Original comment by tres.fin...@gmail.com on 24 Aug 2014 at 2:28