Php yii pdfable数据在底部被截断

Php yii pdfable数据在底部被截断,php,pdf,yii,pdf-generation,Php,Pdf,Yii,Pdf Generation,我正在用pdfable制作一个pdf文档。我已经成功地创建了pdf文档,但是如果我在每一页的顶部和底部设置了一个边距,那么在每一页上都会有数据被截断。在我的控制器中 $pdf = $this->createPdf(); $pdf->setOptions(array('orientation'=>'Landscape', 'margin-top' => 5, 'margin-right'

我正在用pdfable制作一个pdf文档。我已经成功地创建了pdf文档,但是如果我在每一页的顶部和底部设置了一个边距,那么在每一页上都会有数据被截断。在我的控制器中

$pdf = $this->createPdf();
        $pdf->setOptions(array('orientation'=>'Landscape',
                'margin-top'    => 5,
                'margin-right'  => 10,
                'margin-bottom' => 5,
                'margin-left'   => 10,
                )
            );
        $this->layout = 'pdf';
        $pdf->renderPage('pdf',array('results'=>$asaareaList));

        $pdf->send('ProjectReport_'.date('M-Y').'.pdf');
在我看来

<head>
<style type='text/css'>

@media print{thead{display:table-header-group; margin-bottom:2px;}}
@page{margin-top:1cm;margin-left:1cm;margin-right:1cm;margin-bottom:1.5cm;}}

.odd {
    background: none repeat scroll 0 0 #E5F1F4;
}
.even {
    background: none repeat scroll 0 0 #F8F8F8;
}
table tbody tr:hover{
        background: none repeat scroll 0 0 lightgreen;
}
table tbody tr{
    font-size:10pt;
}
body
{
  margin: 0mm 0mm 0mm 0mm;

}

.grey{
    background: lightgrey;
}

.center{
    margin: 0 auto;
    text-align: center;
}

.size{
    font-size:15px;
}

table{
    padding-botton:30px;
}
thead{
    font-size:11px;
     font-weight: normal;
}

</style>
</head>
<!-- <body onload="window.print();window.close();">-->
<body>
<h1 class="grey center">Project Report</h1>
<table>
<?php 
$count = 0;
$class= null;
foreach($results as $key=>$data) {
?>

<tr class="grey size">
    <th colspan=12><?=$key ?></th>
</tr>
<thead>
    <tr>
        <th>Start Date</th>
        <th>Name</th>
        <th>Code</th>
        <th>Actual End Date</th>
        <th>Office</th>
        <th>%</th>
        <th>% Planned</th>
        <th>KM</th>
        <th>KM Planned</th>
        <th>Country</th>
        <th width="150">AREA</th>
        <th>PROJ INFO</th>
    </tr>
</thead>
<tbody>
<?php foreach($data as $column=>$q) {   ?>

    <?php 
        $class = ($count % 2 === 0) ? 'odd' : 'even';
        $this->renderPartial('_report',array('data'=>$q,'class'=>$class));
        $count++;
    }
    ?>
</tbody>


<?php }
?>
</table>
</body>

@媒体打印{thead{显示:表头组;页边距底部:2px;}
@第{页边距顶部:1cm;左侧边距:1cm;右侧边距:1cm;底部边距:1.5cm;}
.奇怪{
背景:无重复滚动0 0#E5F1F4;
}
.甚至{
背景:无重复滚动0 0#F8;
}
表tbody tr:悬停{
背景:无重复滚动0 0浅绿色;
}
表tbody tr{
字号:10pt;
}
身体
{
边缘:0毫米;
}
格雷先生{
背景:浅灰色;
}
.中心{
保证金:0自动;
文本对齐:居中;
}
.尺寸{
字体大小:15px;
}
桌子{
填充波顿:30px;
}
泰德{
字体大小:11px;
字体大小:正常;
}
项目报告
开始日期
名称
代码
实际结束日期
办公室
%
%计划的
公里
规划公里数
国家
地区
项目信息
pdf结果,正如您在底部附近的图片中所看到的,数据被切断。

第二张图片标题的css并没有一直走到Acros,不知道为什么?

这看起来像是CSS问题。您是否尝试过通过控制器中的
$this->render()
呈现PDF预览(请参见Pdfable附带的示例)?它也被切断了吗?如果不是,那就是
wkhtmltopdf
的问题。我不知道你的意思。html视图很好,从html打印也很好。