Sending Print Request From Website To Local QZ Tray?

335 views
Skip to first unread message

Bernie

unread,
Jan 25, 2017, 12:26:32 PM1/25/17
to qz-print
Hi,

https://qz.io/wiki/2.0-getting-started

I was looking at the following link, just to understand this process better; on my website I would have to have my developer use "qz.websocket.connect()" to connect to my local QZ Tray client and then we can send data to the printer; right?

I see with the "demo/sample.html", when I open this page up I receive the "localhost wants to connect to QZ" popup message; which I then click "allow" to connect. 

My question is, if my developer has a "Print" button on the back-end of my website that then calls "qz.websocket.connect()" then the send data to printer code; would I first see that same popup message show up when I click the "Print" button before my send data to printer code is sent?

Thank you!

Tres Finocchiaro

unread,
Jan 25, 2017, 3:58:22 PM1/25/17
to Bernie, qz-print
would I first see that same popup message show up when I click the "Print" button before my send data to printer code is sent?

Yes, the print dialog will appear at least once for every client (never on the server, unless you've explicitly setup a local print server).  The only way to suppress this first dialog in advance is to deploy an allowed.dat file to the PC before hand.  This isn't covered in our tutorial but can be copied from %appdata%\qz to another user in advance if you have access to do so (domain login script, etc).

2.1 will have the ability to deploy this allowed.dat to %programfiles%\QZ Tray\shared to make it system wide, but 2.1 is only available in beta at this moment.

-Tres

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bernie

unread,
Jan 25, 2017, 5:13:33 PM1/25/17
to qz-print, olim...@gmail.com
Hi Tres,

Ok, I see the "allowed.dat" file under the %appdata%\qz directory but it's blank.  I opened up "sample.html" and then clicked "allowed" thinking it would update the "allowed.dat" file but it remained the same.

What data should be showing under the "allowed.dat" file?

Thank you!
To unsubscribe from this group and stop receiving emails from it, send an email to qz-print+u...@googlegroups.com.

Tres Finocchiaro

unread,
Jan 25, 2017, 9:03:16 PM1/25/17
to Bernie, qz-print
allowed.dat will include all certificates that you have clicked "always allow" checkbox on.  Technically, it will include the fingerprint of the certificate as well as some timestamp information.

So you'd first need the cert. :)

-Tres
Reply all
Reply to author
Forward
0 new messages