2015-02-09 5 views
8

Ich versuche, Berichte von Meteor zu erstellen, mit dem SSR-Paket und wkhtmltopdf. Es läuft alles gut, bis auf eine Sache: Wenn ich Bootstrap 3 verbinde, verliere ich alle Farben. Das Spaltenformat, das Tabellenformat usw. ist in Ordnung, aber alles ist weiß auf schwarz. Selbst wenn ich Inline-CSS verwende, ist alles, was ich bekomme, schwarz auf weiß.Mit wkhtmltopdf mit Bootstrap 3 entfernt Farbstile

Wenn ich die Boostrap-Verbindung entferne, kommen alle Farben wie erwartet durch.

Hier ist die Vorlage Ich bin Rendering:

<Template name="spaceUtilSpacePDF"> 
    <html> 
     <head> 
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"> 
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css"> 
     </head> 
     <body> 
      <div class="container-fluid"> 
       <div class="row"> 
        <div class="col-xs-4"> 
         <div class="well"> 
         <table class="table"> 
          <tbody> 
           <tr> 
            <td class="bg-danger"> Stuff</td> 
            <td style="background-color:blue"> Stuff</td> 
            <td style="color:red"> Stuff</td> 
           </tr> 
          </tbody> 
         </table> 
        </div> 
       </div> 
            </div> 
      </div> 
      <div style="page-break-after:always"></div> 
      <button class="btn btn-danger">Test Button</button> 

     </body> 
    </html> 

</Template> 

Antwort

23

Dies ist wahrscheinlich wegen the following snippet from the HTML5 Boilerplate that's included in Bootstrap v3:

/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */ 
// ========================================================================== 
// Print styles. 

@media print { 
    *, 
    *:before, 
    *:after { 
    background: transparent !important; 
    color: #000 !important; // Black prints faster: h5bp.com/s 
    //... 
    } 

können Sie entweder entfernen diese aus Ihrer Kopie von Bootstrap, oder versuchen, es zu überschreiben.

Beachten Sie, dass Bootstrap v4 dieses Snippet entfernt hat.

+0

@crush Die Less/Sass-Datei herunterladen und konfigurieren? –