qzind / tray

Browser plugin for sending documents and raw commands to a printer or attached device.
https://qz.io
Other
849 stars 276 forks source link

Print HTML - The page got 'cut off' if long content #690

Closed Jasphine closed 4 years ago

Jasphine commented 4 years ago

Hi,

I'm trying to print a html receipt(with long content), but when the content is too long, the page got 'cut off' or there is a page break in the middle(blank) of the page. image

FYI, i have set scaleContent: false.Also, I have used QZ Tray 2.1.0. How to solve this?

Appreciate your help.

Thanks a lot.

tresf commented 4 years ago

This can happen if the default page size it not tall enough (e.g. A4/US Letter). The driver settings should allow alonger page-cut off.

Can you post:

  1. Your OS
  2. Your QZ Tray version
  3. An example of the HTML you're sending
  4. The printer manufacturer you're using

Furthemore, we've greatly improved HTML handing in 2.1.1, so it may be worth upgrading although this specific cutoff issue is usually driver related.

Jasphine commented 4 years ago

Hi @tresf

Appreciate and thanks for your reply.

Below are the answers for your questions:-

  1. Your OS Answer: Window

  2. Your QZ Tray version Answer: Qz Tray 2.1.0+1

  3. An example of the HTML you're sending Answer: <meta name="viewport" content="width=device-width, initial-scale=1"><meta charset="utf-8"><style>.print-screen,.print-screen td,.print-screen th { font-family: 'Verdana'; font-size: 8pt; } .print-screen big { font-size:1em } .print-screen *[r] ,.print-screen .right{ text-align:right } .print-screen *[c] ,.print-screen thead td{ text-align:center } .print-screen hr { border:0;border-top:1px solid black; } .print-screen tbody td, .print-screen tbody th { vertical-align:top } .print-screen .header,.print-screen footer { margin: 2em 0; } .print-screen .personaliseInfo{ padding-left:10px;font-size:6pt;} .print-screen .fBold{font-weight:bold;} .print-screen img{max-height:50px;} .print-screen .tax-summary-table{border:1px solid black;margin-top:100px;padding:10px;} .print-screen .row-border-bottom{border-bottom:1px solid black;} .print-screen .tax-label{font-size: 6pt;} .print-screen .logo-img img{max-height:50px;} .print-screen div.outletName, .print-screen div.storeName {font-size:10pt;font-weight:bold;} .print-screen div.outletAddress,.print-screen div.outletTaxRegNo,.print-screen div.outletTelephone{font-size:7pt;} .print-screen td.line {border-bottom:1px solid black;} .print-screen .main-table{ margin-left:auto;margin-right:auto;} @media print {@page {margin:5mm 5mm 0mm 0mm;} div{page-break-inside: avoid;page-break-after: avoid;page-break-before: avoid;}}</style><div class="print-screen"><table class="main-table" width="100%"><thead><tr><td colspan="5"><div class="storeName">xxxxxxxxxx Marketing Sdn Bhd</div><div class="companyRegNo">Co. Reg. No : (xxxxxx-D)</div><div class="TaxRegNo">xxx Reg.No. : xxxxxxxxxxxx</div><div class="outletAddress">xx-x, xx-x &amp; xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx</div><div class="companyURL">URL : xxx.yyy.zzz</div><div class="companyEmail">Email : aaa@xxx.xxx</div></td></tr><tr><td colspan="5" align="center">Tel: + xxxxx xxxxx xxxxx</td></tr><tr><td colspan="2" align="left" id="orderDateOnly">06/06/2020</td><td colspan="3" align="left" class="fBold">Tax Invoice</td></tr></thead><tbody><tr><td colspan="2" align="left" class="cashier-row">Cashier : Cashier1</td><td colspan="2" class="right">No.: xxxxxx</td></tr><tr class="customer-row"><td>Customer Name :</td><td colspan="3" class="right"> xxxxx xxxxx</td></tr><tr><td colspan="5" class="line"></td></tr><tr valign="top"><td>Item</td><td c="" width="10%">Qty</td><td r="" width="20%">U.Price</td><td r="" width="20%">MYR</td><td width="5%"></td></tr><tr><td colspan="5" class="line"></td></tr><tr valign="top" class="product-row"><td>Bumble Bee: Baby Latex Mattress 24" x 48" x 3"</td><td c="" width="10%">1</td><td r="" width="20%">335.90</td><td r="" width="20%">335.90</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Tommee Tippee: Closer To Nature - Decorated Bottle Newborn Starter Set(Pink ( 423742/38 ))</td><td c="" width="10%">1</td><td r="" width="20%">159.00</td><td r="" width="20%">159.00</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Koopers: Danza Infant Carrier - BLACK STRIPE</td><td c="" width="10%">1</td><td r="" width="20%">279.00</td><td r="" width="20%">279.00</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>ComfyBaby: Mosquito Net</td><td c="" width="10%">1</td><td r="" width="20%">103.20</td><td r="" width="20%">103.20</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Pigeon: Liquid Cleanser - Refill Value Pack (BEST BUY)</td><td c="" width="10%">1</td><td r="" width="20%">44.50</td><td r="" width="20%">44.50</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Joielle Baby: Baby Bath 250ml</td><td c="" width="10%">1</td><td r="" width="20%">28.80</td><td r="" width="20%">28.80</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>BabyLove: Premium Air-Filled Rubber Cot Sheet(Pink)</td><td c="" width="10%">1</td><td r="" width="20%">27.90</td><td r="" width="20%">27.90</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Theraline: Maternity &amp; Nursing Pillow - Happy Sheep(Yellow Flower (TH52024100))</td><td c="" width="10%">1</td><td r="" width="20%">296.65</td><td r="" width="20%">296.65</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Autumnz: Home Bottle Warmer(Lilac)</td><td c="" width="10%">1</td><td r="" width="20%">65.60</td><td r="" width="20%">65.60</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Earth Mama Angel Baby: Natural Nipple Butter 1oz</td><td c="" width="10%">1</td><td r="" width="20%">40.40</td><td r="" width="20%">40.40</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Holabebe: Swaddlebebe Infant Wrap - Raining Day (A354-17)</td><td c="" width="10%">1</td><td r="" width="20%">31.90</td><td r="" width="20%">31.90</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Hudson Baby: Washcloths Woven Terry - 4pcs (57231)</td><td c="" width="10%">1</td><td r="" width="20%">23.10</td><td r="" width="20%">23.10</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Lacte: Deluxe Disposable Breast Pad - 36pcs</td><td c="" width="10%">1</td><td r="" width="20%">15.20</td><td r="" width="20%">15.20</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Bebe Comfort: Headbands - 3pcs (BC73085)</td><td c="" width="10%">1</td><td r="" width="20%">15.90</td><td r="" width="20%">15.90</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Shapee: Disposable Ladies' Cotton Panties - 4pcs (BEST BUY)(M)</td><td c="" width="10%">1</td><td r="" width="20%">9.90</td><td r="" width="20%">9.90</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Autumnz: Washable Breastpads 6pcs - Nude</td><td c="" width="10%">1</td><td r="" width="20%">14.30</td><td r="" width="20%">14.30</td><td width="5%" r="" class="tax-label"></td></tr><tr valign="top" class="product-row"><td>Bumble Bee: Socks: Snow White Chenille Socks</td><td c="" width="10%">1</td><td r="" width="20%">11.10</td><td r="" width="20%">11.10</td><td width="5%" r="" class="tax-label"></td></tr><tr><td colspan="5" class="line"></td></tr><tr valign="top" class="tax-row" style="display: none;"><td r="" colspan="3" class="fBold">Total Amount Incl. <!--tax summary label--> <!--tax value--> :</td><td r="" width="30%" id="amountIncludeTax">1,781.55</td><td width="5%"></td></tr><tr valign="top" class="rounding-row" style="display: none;"><td r="" colspan="3">Rounding Adjustment:</td><td r="" width="30%"><!--total rounding--></td><td width="5%"></td></tr><tr valign="top" class="total-discount-row"><td r="" colspan="3">Total Discount:</td><td r="" width="30%">117.90</td><td width="5%"></td></tr><tr valign="top" class="discount-row"><td r="" colspan="3">Mid Year Sale Discount</td><td r="" width="30%">(117.90)</td><td width="5%"></td></tr><tr valign="top"><td r="" colspan="3" class="fBold">Total Amount Payable:</td><td r="" width="30%">1,663.65</td><td width="5%"></td></tr><tr valign="top" class="payment-row"><td r="" colspan="3" class="">Paid Visa/MC Amount:</td><td r="" width="30%">1,663.65</td><td width="5%"></td></tr><tr valign="top" class="change-row" style="display: none;"><td r="" colspan="3" class="fBold">Change:</td><td r="" width="30%"><!--total change--></td><td width="5%"></td></tr><tr valign="top"><td r="" colspan="3">Total Qty Tender:</td><td r="" width="30%">18</td><td width="5%"></td></tr><tr><td colspan="5" class="row-border-bottom"></td></tr><tr valign="top" align="center"><td colspan="5"><table width="95%" class="tax-summary-table" style="display: none;"><tbody><tr><td width="35%"><span style="border-bottom: 1px solid black;"><!--tax summary label--> Summary</span></td><td width="25%"><span style="border-bottom: 1px solid black;">Amount(MYR)</span></td><td width="25%"><span style="border-bottom: 1px solid black;">Tax(MYR)</span></td></tr><tr><td width="35%">S = <!--tax value--></td><td width="25%"><!--amount required tax--></td><td width="25%"><!--total tax--></td></tr><tr><td width="35%">Z = 0%</td><td width="30%"><!--amount without tax--></td><td width="30%">0.00</td></tr></tbody></table></td></tr><tr valign="top"><td c="" colspan="5"><br>*Goods sold are not returnable</td></tr><tr valign="top"><td c="" colspan="5"><br><br>Thank You for shopping at <br> xxxxx Marketing Sdn Bhd<br><br></td></tr><tr valign="top"><td c="" colspan="5" id="orderDateTime">06/06/2020 04:54:13PM</td></tr></tbody></table><center><br><br>*****Duplicate Copy*****</center></div>

  4. The printer manufacturer you're using Answer: Gprinter - GP-7645

I tried to search for the solution, but I can't find any. That's why I hope if anyone of you can help me.

Really appreciate for your help. Thanks!!!

tresf commented 4 years ago

Thanks.

Can you confirm that the driver is set to use the tallest page height?

Also, we've made some improvements to HTML in 2.1.1+1. Does the problem still occur there?

Jasphine commented 4 years ago

Hi @tresf ,

I will take your advice and let you know the result soon.

Thanks and appreciate your help. Thank you so much!!!

tresf commented 4 years ago

@Jasphine if that doesn't help, our next step will be to try to reproduce on a receipt printer that we have to spot any oddities.

Jasphine commented 4 years ago

Hi @tresf ,

I have set the printer to use the tallest height and the issue is solved. The receipt can print properly now.

Thanks a lot for your help and appreciate. Thank you!!!!!

tresf commented 4 years ago

@Jasphine thanks kindly for sharing your success!