1

I want to show the html in pdf only on one page. But it makes it on multiple pages. I tried to add css modifications, but it didn't work eather. There are plently of options to choose, but cant find one that suits.

options avaliable https://github.com/mikehaertl/phpwkhtmltopdf http://wkhtmltopdf.org/usage/wkhtmltopdf.txt

php

$options = array(
        'no-outline',         // Make Chrome not complain
        'margin-top'    => 0,
        'margin-right'  => 0,
        'margin-bottom' => 0,
        'margin-left'   => 0,
        // Default page options
        'disable-smart-shrinking',

        'user-style-sheet' => PATH . '/assets/pdf.css',
    );

pdf.css

table:first {
    position:   relative;
    top:        1cm;
    left:       1cm;
    width:      2cm;
    height:     1.6cm;
}

table {
 font-size:      10px;
 font-family:    Arial;

}
Keyur
  • 1,113
  • 1
  • 23
  • 42
Elīna Legzdiņa
  • 307
  • 1
  • 3
  • 11
  • Does the content fit on one page? If not then its quiet logical that it generates more then one page. Note that this includes margins, white space etc. – Sitethief Nov 23 '16 at 08:54
  • It doesn't matter if it fits on one page. Its should be possible to scale it down, to fit it on one page. And as the quality is good on pdf, we can zoom in later on – Elīna Legzdiņa Nov 23 '16 at 09:39
  • You could try decreasing the font-size. – Sitethief Nov 23 '16 at 09:40

0 Answers0