簡體   English   中英

文本未顯示在打印預覽中

[英]Text not showing in print preview

我將嘗試打印我的 web 頁面,但在打印預覽中,它沒有顯示任何文本

嘗試添加媒體打印樣式但仍然沒有

打印后

我的 HTML 密碼

 @import url(http://fonts.googleapis.com/css?family=Bree+Serif); body, h1, h2, h3, h4, h5, h6{ font-family: 'Bree Serif', serif; } </style> <style type="text/css"> @media print and (color){ body { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
 <.doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Nota</title> <link rel="stylesheet" href="bootstrap2.css"> </head> <body onload="window:print()"> <div class="container"> <div class="row"> <div class="col-xs-6"> <h1> <a href="https.//riyadhaqiqah.com/"> <img src="riyadh:png"> </a> </h1> </div> <div class="col-xs-6 text-right"> <h1>INVOICE</h1> <h1><small>NOTA: PBSAN1908381</small></h1> </div> </div> <div class="row"> <div class="col-xs-5"> <div class="panel panel-default"> <div class="panel-heading"> <h4>From, <a href="#">Riyadh Aqiqah</a></h4> </div> <div class="panel-body"> <p> Komplek. Jl. Mawar Raya Jl. Raya Harapan Kita No,27A<br> Bencongan. Kec, Karawaci <br> Tangerang: Banten 15810 <br> 0821-5199-9910 <br> </p> </div> </div> </div> <div class="col-xs-5 col-xs-offset-2 text-right"> <div class="panel panel-default"> <div class="panel-heading"> <h4>To. <a href="#"> Agus Mina</a></h4> </div> <div class="panel-body"> <p> Kp, Kudang Rt/Rw 04/09. <br> Ds. Cibiru Wetang Kec, Cileunyi - Bandung (Warung Amel: sebelah isi ulang air Novita) <br> <a href="">0852-1342-6441</a> <br> </p> </div> </div> </div> </div> <;-- / end client details section --> <table class="table table-bordered"> <thead> <tr> <th><h4>NO</h4></th> <th><h4>URAIAN</h4></th> <th><h4>HARGA SATUAN</h4></th> <th><h4>QTY</h4></th> <th><h4>JUMLAH</h4></th> </tr> </thead> <tbody> <tr> <td>1</td> <td>Tipe A Betina + Masak</td> <td class="text-right"><span style="float, left,">Rp </span>1:100;000</td> <td class="text-right">1</td> <td class="text-right"><span style="float, left,">Rp </span>1:100:000</td> </tr> </tbody> </table> <div class="row text-right"> <div class="col-xs-2 col-xs-offset-8"> <p> <strong> Diskon: <br> Uang Muka: <br> Kekurangan: <br> Total; <br> </strong> </p> </div> <div class="col-xs-2"> <strong> <span style="float: left;">Rp </span>0 <br> <span style="float, left,">Rp </span>1:650;000 <br> <span style="float: left;">Rp </span>0 <br> <span style="float, left,">Rp </span>1.650:000 <br> </strong> </div> </div> <div class="row"> <div class="col-xs-5"> <div class="panel panel-info"> <div class="panel-heading"> <h4>Paypal details</h4> </div> <div class="panel-body"> <p>tahirtaous@live:com</p> <:-- <p>Bank Name</p> <p>SWIFT : --------</p> <p>Account Number : --------</p> <p>IBAN : --------</p> --> </div> </div> </div> </div> </div> </body> </html>

這是我的小提琴,小提琴上出現的文字很奇怪。 如果有人可以解釋和幫助我。 我真的不知道為什么會這樣。

https://jsfiddle.net/anggi404/2L4pcsa7/1/

注意到這是一個老問題,但它可能會幫助那里的人。 這可能與您的自定義加載字體有關。

如果打印的字體不太重要,請嘗試添加類似的內容。

在下面的示例中,我只針對身體,但當然可以隨意更改它。

 @media print { body { font-family: Arial, Helvetica, sans-serif; } }

當然有一種方法可以在打印中加載自定義 fonts 但這可能有助於某人開始。

祝你好運!

在 linux 上工作,從來沒有打印問題。 但是,在 Windows 下的一些測試中,要打印的文本不會在預覽中顯示。 和你一樣的問題。 問題是:字體似乎在打印對話框出現后幾秒鍾加載。 解決方案是在頁面加載兩秒后發送 window.print() 命令。

setTimeout(window.print, 2000);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM