English 中文(简体)
塞内加尔国防军外面的空白页
原标题:Extra blank page with TCPDF

我正在利用PDF转换一个由Schql 查询组生成的网页,每张记录中都使用“破碎后:航道”,这些记录将随时间而变化。

当我用以下代码将其转换到pdf时,我最终会获得一个额外的空白页? 如果一只没有字体的纪录片,就没有空白页?

<?php
error_reporting(0); //Don t show errors in the PDF 
ob_clean(); //Clear any previous output 
ob_start(); //Start new output buffer 
require_once( ../pdf/config/lang/eng.php );
require_once( ../pdf/tcpdf.php );
class MYPDF extends TCPDF {
public function Header() {
}
public function Footer() {
    $this->SetY(-50);
    $this->SetFont( helvetica ,  I , 8);
    $this->Cell(0, 5,  Some text ,0, 1,  L , 0,   , 0, false,  T ,  T );
$this->Cell(0, 5,  Some text ,0, 1,  L , 0,   , 0, false,  T ,  T );
    $this->SetFont( helvetica ,  I , 12);
$this->Cell(0, 15,  Signed_____________________________________________ ,0, 1,  L ,                0,   , 0, false,  T ,  B );
$this->Cell(0, 15,  Print Name_____________________________________________ Date________________________ ,0, 1,  L , 0,   , 0, false,  T ,  B );    
}
}
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true,  UTF-8 , false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor( Author );
$pdf->SetTitle( Delivery Notes );
$pdf->SetSubject( Delivery Notes );
$pdf->SetKeywords( TCPDF, PDF, );
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(10, 10, 10);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
$pdf->setLanguageArray($l);
$pdf->SetFont( helvetica ,   , 10);
$pdf->AddPage( P ,  LETTER );
$include=$_POST[ include ];
include($include); 
$html = ob_get_contents();
ob_clean();
$html = preg_replace("/ss+/",   , $html); //Strip excess whitespace 
$pdf->writeHTML($html, true, false, true, false,   );
$pdf->lastPage();
$pdf->Output( delivery.pdf ,  I );

事先感谢你

Peter

最佳回答

1. 使用

.element:last-child{page-break- subsequently:auto;}

如有要素,则由社会保障局的遴选人担任。

问题回答

暂无回答




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签