Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/EmptyTag/152.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php FPDF中的FPDF分页符_Php_Fpdf - Fatal编程技术网

Php FPDF中的FPDF分页符

Php FPDF中的FPDF分页符,php,fpdf,Php,Fpdf,我正在使用PHP和FPDF生成带有项目列表的PDF。我的问题是,该项目不会转到第二页或第三页 我想在pdf的第二页打印下一块数据。 有人请帮帮我。我使用了setautopage break(),但不起作用

我正在使用PHP和FPDF生成带有项目列表的PDF。我的问题是,该项目不会转到第二页或第三页

我想在pdf的第二页打印下一块数据。 有人请帮帮我。我使用了
setautopage break()
,但不起作用<请帮忙

       <?php

        require('fpdf.php');

        class PDF extends FPDF {

            function Header() { 

                $this->SetFont('Arial','B',10);    
                $this->Rect(50,30,100,30,'F');
                $this->Text(80,45,"3D");
                $this->SetXY(20,20);
                $this->Cell(30,10,'A',1,0,'L');             
                $this->SetXY(80,20);
                $this->Cell(30,10,'B',1,0,'L');                                         
                $this->SetXY(80,60);
                $this->Cell(30,10,'C',1,1,'L');             
                $this->SetXY(150,60);
                $this->Cell(30,10,'D',1,1,'L');             
            }   

            function Footer() {
                $this->SetY(-12);
                $this->Cell(169,20,'Page '.$this->PageNo().'/{nb}',0,0,'C');   
            }

            $pdf=new PDF();
            $pdf->AddPage(); 
            $pdf->SetFont('Arial','B',16);
            $pdf->AliasNbPages();
            $pdf->Output();
为此,您需要使用和

使用GetY获取当前位置,从文档高度中减去它。如果这小于多单元格高度的6倍(您有6行),则使用AddPage强制分页符。


查看详细答案

您的项目列表在哪里?你能提供一些代码吗?