简体   繁体   English

FPDF奇怪地将图像放到CELL中

[英]FPDF weirdly error put image in CELL

i have no idea about this, why the image is out of the line 我对此一无所知,为什么图像不清晰

here's the result 这是结果

在此处输入图片说明

here's my codes 这是我的密码

        $fpdf->Cell(65,30,$fpdf->Image('assets/images/qrcodes/qrcodse.png', $fpdf->GetX(), $fpdf->GetY(), 30),1,0,'',false);
            $fpdf->cell(10,30,'',0,0,'');
        $fpdf->Cell(65,30,$fpdf->Image('assets/images/qrcodes/qrcodse.png', $fpdf->GetX(), $fpdf->GetY(), 30),1,0,'',false);
            $fpdf->Ln(33);

        $fpdf->Cell(65,30,$fpdf->Image('assets/images/qrcodes/qrcodse.png', $fpdf->GetX(), $fpdf->GetY(), 30),1,0,'',false);
            $fpdf->cell(10,30,'',0,0,'');
        $fpdf->Cell(65,30,$fpdf->Image('assets/images/qrcodes/qrcodse.png', $fpdf->GetX(), $fpdf->GetY(), 30),1,0,'',false);
            $fpdf->Ln(33);

        $fpdf->Cell(65,30,$fpdf->Image('assets/images/qrcodes/qrcodse.png', $fpdf->GetX(), $fpdf->GetY(), 30),1,0,'',false);
            $fpdf->cell(10,30,'',0,0,'');
        $fpdf->Cell(65,30,$fpdf->Image('assets/images/qrcodes/qrcodse.png', $fpdf->GetX(), $fpdf->GetY(), 30),1,0,'',false);
            $fpdf->Ln(33);

        $fpdf->Cell(65,30,$fpdf->Image('assets/images/qrcodes/qrcodse.png', $fpdf->GetX(), $fpdf->GetY(), 30),1,0,'',false);
            $fpdf->cell(10,30,'',0,0,'');
        $fpdf->Cell(65,30,$fpdf->Image('assets/images/qrcodes/qrcodse.png', $fpdf->GetX(), $fpdf->GetY(), 30),1,0,'',false);
            $fpdf->Ln(33);

it's only looping the same CELL function 它只是循环相同的CELL函数

Thanks!!! 谢谢!!!

The Cell() method expects a string as its third parameter. Cell()方法期望将字符串作为其第三个参数。 While the Image() method does not return anything. 虽然Image()方法不返回任何内容。

That writing: You cannot place an image into a cell this way. 这样写:您不能以这种方式将图像放置到单元格中。 It does not do what you expect. 它没有达到您的期望。

Just move the Image() calls before each Cell() call and you will see no difference. 只需在每次Cell() Image()调用之前移动Image()调用,您将看不到任何区别。

The page break you see is triggered because the later Cell() call is triggering it. 您看到的分页符被触发,因为稍后的Cell()调用触发了它。 You may disable it or set another bottom margin value through the SetAutoPageBreak() method: 您可以通过SetAutoPageBreak()方法禁用它或设置另一个下边距值:

$fpdf->SetAutoPageBreak(false);
// or
$fpdf->SetAutoPageBreak(true, 0);

If you disable it, you will need to add the pages yourself. 如果禁用它,则需要自己添加页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM