Full support for printing HTML and CSS

1,266 views
Skip to first unread message

dave.r...@gmail.com

unread,
Feb 27, 2015, 3:17:23 PM2/27/15
to qz-p...@googlegroups.com
We are in the process of evaluating the QZ-Print plugin solution for use in our web based applications.

Our applications run in various hardware environments (e.g. desktops, laptops, tablets) with many browsers (e.g. Chrome, Firefox, Safari, Internet Explorer) and under various software environments (e.g. Windows, Mac OS, iOS, Android).

We have three types of printers to which output needs to be sent: standard printer with 8.5 x 11 in paper, thermal receipt printers with 80mm paper roll (e.g. EPSON, POSX, Star), and label printers with various sized labels (e.g. Zebra GK420d).

The content that needs to be sent to these printers has been carefully crafted via HTML and CSS. Things are working correctly when the browser print operation is invoked. However, we want to bypass the browser print invocation and send the printer output programatically. This will enable us to reduce the number of clicks our users experience when printing something.)

We have been conducting some tests using the free version of your product using the sample.html code as a model.

Up to a point, the printHTML example in the QZ-Print sample.html code meets our needs. However, the comment in that code indicates that only "plain HTML 1.0" can be managed by this routine. We have conducted tests which reveal that the following CSS elements are not processed properly:

float: left
display: inline-block
transform-origin: left bottom
transform: rotate(90deg) translate(-50px,0px)

Is there any possibility that the printHTML approach is more fully implemented in the "professional" version of your product?

Will the printHTML5 approach illustrated in your sample.html code be likely to handle these additional CSS elements?

The fundamental question here is this: will the latest version of the "professional" release of your product properly handle the presentation of printer output that is specified within a web page using HTML and CSS? More specifically, can we send as input a string that contains HTML and CSS code and produce as output the proper result on the appropriate printer?

Tres Finocchiaro

unread,
Feb 27, 2015, 3:26:02 PM2/27/15
to Dave Eland, qz-p...@googlegroups.com
Is there any possibility that the printHTML approach is more fully implemented in the "professional" version of your product?

No, not currently.

Will the printHTML5 approach illustrated in your sample.html code be likely to handle these additional CSS elements?

For HTML5 capable browsers, yes.   There are limitations imposed by the 72 dpi of the screen which require special consideration to get high quality printing.

Also, we currently have no direct support for iOS or Android.

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

dave.r...@gmail.com

unread,
Feb 27, 2015, 3:53:00 PM2/27/15
to qz-p...@googlegroups.com, dave.r...@gmail.com
Thanks for your timely reply.

We will investigate the printHTML5 approach and see how things work out.

Tres Finocchiaro

unread,
Feb 27, 2015, 4:19:17 PM2/27/15
to Dave Eland, qz-p...@googlegroups.com
For starters, you will need to restrict canvas size using this:

If not, the canvas is based on the browser window size.

Tres Finocchiaro

unread,
Feb 28, 2015, 9:26:37 AM2/28/15
to Dave Eland, qz-p...@googlegroups.com
@Dave,

Yes, we've done this using some CSS sizing techniques.  The html2canvas renders at 72dpi which is generally unacceptable for scanning purposes.  The remedy is to render it at 3x (or more) its magnification so that the print quality is acceptable.

I've created an issue on our tracker to better document our success with this initiative.


-Tres


On Fri, Feb 27, 2015 at 5:33 PM, Dave Eland <dave.r...@gmail.com> wrote:
One of the things we need to render is a barcode embedded in the output.  Our current solution uses <div> with float:left to stack up a bunch of black and white lines with the proper pattern.  Do I understand you have examples on how to work with this?

dave.r...@gmail.com

unread,
Feb 28, 2015, 9:53:02 AM2/28/15
to qz-p...@googlegroups.com, dave.r...@gmail.com
Thanks for the sample code you have posted.

I will begin experimenting with it today.

We greatly appreciate your timely responses and very helpful input on our questions!

Tres Finocchiaro

unread,
Mar 11, 2015, 2:22:19 PM3/11/15
to Dave Eland, qz-p...@googlegroups.com
@Dave,

That Code39.js file was bad.  We've updated our tutorial with one that works properly. Sorry for any grief this has caused.


-Tres
Reply all
Reply to author
Forward
0 new messages