0

我只想在一页上显示 pdf 格式的 html。但它使它在多个页面上。我试图添加 css 修改,但它没有工作。有很多选择,但找不到适合的。

可用选项 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;

}
4

0 回答 0