Tag - wkhtmltopdf - liczba wpisów 4

Wkhtmltopdf table td background color Kategoria: PHP | Tagi: CSS, wkhtmltopdf | Autor: Bartłomiej Gałęzia

Przede wszystki kolorujemy komórki TD a nie wiersze TR

thead th,
thead td {
    background-color: #a9d388 !important;
}

trzeba też dodać border-collapse dla tabeli

table {
    border-collapse: collapse;
}

po tych zmianach działa

Wkhtmltopdf - header i footer Kategoria: PHP | Tagi: wkhtmltopdf | Autor: Bartłomiej Gałęzia

wkhtmltopdf --print-media-type --header-html header.html --footer-html footer.html https://google.pl/ google.pdf

Wkhtmltopdf - Page Break Kategoria: PHP | Tagi: wkhtmltopdf | Autor: Bartłomiej Gałęzia

HTML

<div class="new-page"></div>

CSS

@media print {
    .new-page {
        page-break-after: always;
    }
}

lub bezpośrednio w HTML

<div style="page-break-after: always;"></div>

Ważne!

Znacznik "new-page" nie może być wewnątrz znacznika <section> bo nie zadziała.

Czasami (np.: na serwerach CyberFolks) trzeba dodaj w komendzie --print-media-type

wkhtmltopdf --print-media-type http://domena.pl/file.html file_pdf.pdf

Wkhtmltopdf - Unwanted Scrollbars Kategoria: PHP | Tagi: wkhtmltopdf | Autor: Bartłomiej Gałęzia

Remove "table-responsive" class from your HTML.

<div class="box box-text table-responsive"> 
<div class="box-header text-center">
<h3 class="box-title">Zrealizowane zadania
</h3> 
</div>