Cannot find printer under the JavaFX libraries QZ Tray v2.1.2

456 views
Skip to first unread message

Carlos R Canas

unread,
Apr 24, 2021, 10:00:23 PM4/24/21
to qz-print
This message appeares using the demo qz-tray and with the test webpage that we setup to see if we can incorporate qz-tray into our web ordering system. 
Even though the message shows up, the demo page prints ok, but not our test order ticket.  This just started to happen, it worked fine a few hours ago.

The message does not shows and everything works when we print a pdf or an image from qz-tray demo page.  We do not have anything setup for that on our test web page.

Here is the java script we use (we copied and modified your sample):
From within a jquery click activated function:

$("#va-orders-admin-content").on("click",".va_orders_admin_print_ticket",function () {

                  var posting = $.post(
                               $("#url").val(),
                               { 
                                nonce: $("#nonce").val(),
                                order_id: $(this).attr('order-id'),
                                ticket_type: $(this).attr('ticket-type'),
                                action: 'va_orders_admin_print_ticket'
                               }
                  );

                  posting.done(function( data ) {

                     qzconnect().then(function() {return qzprint(data);}).then(function()           {qzsuccess();}).catch(qzfail);                  
 
            });

    });

 And the functions are:
qzconnect().then(function() {return qzprint(data);}).then(function() {qzsuccess();}).catch(qzfail);

function qzconnect() {
 
    return new Promise(function(resolve, reject) {
        if (qz.websocket.isActive()) {  // if already active, resolve immediately
            resolve();
        } else {
          
            // try; to connect once before firing the mimetype launcher
            qz.websocket.connect().then(resolve, function retry() {
                // if a connect was not successful, launch the mimetime, try 3 more times
                window.location.assign("qz:launch");
                qz.websocket.connect({ retries: 2, delay: 1 }).then(resolve, reject);
            });
        }
    });
}

function qzprint(data) {

  var printer = 'canon';
  var top = 0.25, right = 0, bottom = 0, left = 0.25;

  var config = qz.configs.create(printer, { margins: [ top, right, bottom, left] }); 

    var printdata = [{ 
                    type: 'pixel',
                    format: 'html',
                    flavor: 'plain', 
                    data: data 
                    }];
                                          
     return qz.print(config, printdata);
}

// notify successful print
function qzsuccess() { 
    //alert("Success");
}

// exception catch-all
function qzfail(e) {
    alert(e);
}
 As I said, it worked fine until just an hour ago.

Thank you




Lite Finocchiaro

unread,
Apr 24, 2021, 10:45:02 PM4/24/21
to Carlos R Canas, qz-print
Carlos:

I think this was caused by an update to Oracle Java 8.

Can you please install AdoptOpenJDK 11, HotSpot, and share your findings?




Kind regards,

Lite Finocchiaro
VP, QZ Industries

--
You received this message because you are subscribed to the Google Groups "qz-print" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qz-print/b594488f-19fe-42c3-9d6c-8b017b94bb13n%40googlegroups.com.

Carlos R Canas

unread,
Apr 24, 2021, 11:18:09 PM4/24/21
to qz-print
OK, that fixed the problem. 

Thanks.

Reply all
Reply to author
Forward
0 new messages