2017-01-18 49 views
1

時保持我需要打印以下頁面:佈局不打印頁面的Zend Framework 2引導

Page to print

但不出所料,結果並不:

Result of print

它看起來像我的引導CSS不會在我打印網頁時使用。

這是我的網頁的HTML代碼:

<html lang="fr"> 
    <head> 
     <meta charset="utf-8"> 
     <title>Route Du Drive</title> 
     <meta name="viewport" content="width=device-width, initial-scale=1.0"> 
     <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
     <!-- Le styles --> 
     <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,300,600,700&amp;subset=all" media="screen" rel="stylesheet" type="text/css"> 
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" media="screen" rel="stylesheet" type="text/css"> 
<link href="/metronic/global/plugins/simple-line-icons/simple-line-icons.min.css" media="screen" rel="stylesheet" type="text/css"> 
<link href="/metronic/global/plugins/bootstrap/css/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css"> 
<link href="/metronic/global/plugins/bootstrap-switch/css/bootstrap-switch.min.css" media="screen" rel="stylesheet" type="text/css"> 
<link href="/img/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"> 
<link href="/metronic/global/css/components-md.min.css" media="screen" rel="stylesheet" type="text/css"> 
<link href="/metronic/global/css/plugins-md.min.css" media="screen" rel="stylesheet" type="text/css"> 
<link href="/metronic/pages/css/login-4.min.css" media="screen" rel="stylesheet" type="text/css"> 
<link href="/css/global.css" media="screen" rel="stylesheet" type="text/css"> 
     <!-- Scripts -->   
    </head> 
    <body cz-shortcut-listen="true"> 
    <header> 
    </header> 
    <div class="row"> 
     <div class="col-xs-1"></div> 
     <div class="col-xs-3"> 
      <h3>Commande N°O001</h3> 
      <h4>Boulangerie Ange Oceanis</h4> 
      <h4>1 Rue de la Côte de Nacre</h4> 
      <h4>44600 Saint-Nazaire</h4> 
     </div> 
     <div class="col-xs-1"></div>  <div class="col-xs-3"><h3>Commande archivée</h3></div> 
     <div class="col-xs-3"> 
      <h3>Nom du client</h3> 
     </div> 
    </div> 
    <div class="row"> 
     <div class="col-xs-1"></div> 
     <div class="col-xs-10"> 
      <h3 class="text-center">Articles commandés</h3> 
      <table class="table table-striped table-bordered"> 
       <thead> 
        <tr> 
         <th>Check</th> 
         <th>Référence</th> 
         <th>Dénomination</th> 
         <th>Prix unitaire</th> 
         <th>Quantité</th> 
         <th>Cout</th> 
        </tr> 
       </thead> 
       <tbody> 
        <tr> 
         <td></td> 
         <td>PAIN</td> 
         <td>Baguette de pain</td> 
         <td>0.93 €</td> 
         <td>9</td> 
         <td>8.37 €</td> 
        </tr> 
        <tr> 
         <td colspan="4"></td> 
         <td><b>Total commande</b></td> 
         <td>8.37 €</td> 
        </tr> 
       </tbody> 
      </table> 
      <a href="../manageshop/boulangerieangeoceanis" class="btn btn-primary"><i class="fa fa-arrow-left" aria-hidden="true"></i> Retour à la page précédente</a> 
     </div>   
<script type="text/javascript" src="/js/jquery-2.2.4.min.js"></script> 
<script type="text/javascript" src="/js/global.js"></script> 
<script type="text/javascript" src="/metronic/global/plugins/bootstrap/js/bootstrap.js"></script> 
<script type="text/javascript" src="/metronic/global/plugins/js.cookie.min.js"></script> 
<script type="text/javascript" src="/metronic/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js"></script> 
<script type="text/javascript" src="/metronic/global/plugins/jquery.blockui.min.js"></script> 
<script type="text/javascript" src="/metronic/global/plugins/bootstrap-switch/js/bootstrap-switch.min.js"></script> 
<script type="text/javascript" src="/metronic/global/plugins/backstretch/jquery.backstretch.min.js"></script> 
<script type="text/javascript" src="/metronic/global/scripts/app.min.js"></script>  

我怎樣才能打印網頁與原來的造型? 有人有一個想法是什麼導致問題?

+0

打印頁面上的樣式不同。 – claudios

+0

如何在zend上更改它? –

+0

嘗試檢查您的頁面打印預覽如果它顯示相同的頁面 – claudios

回答

2

嘗試找到下面一行:

<link href="/metronic/global/plugins/bootstrap/css/bootstrap.min.css" media="screen" rel="stylesheet" type="text/css"> 

,並更改爲

<link href="/metronic/global/plugins/bootstrap/css/bootstrap.min.css" media="all" rel="stylesheet" type="text/css"> 

的變化是在media="screen"media="all"。此更改將確保在屏幕上以及在您的打印中顯示頁面的樣式相同。

詳細瞭解media屬性herehere on MDN