QR(write2DBarcode)TCPDF上的代码

问题描述 投票:0回答:1

我正在尝试在同一行中创建一个包含两个不同QR码的PDF,但我得到的第二个QR码的大小不同,请查看下面的代码和图片。

        $pdf->write2DBarcode('http://xxxx.xxx.php?sc='.$linha_id_to_print->xxx, 'QRCODE,Q', 7,62,15,15, $style, 'N');
        $pdf->write2DBarcode('http://xxxx.xxx.php?sc='.$linha_id_to_print->xxx, 'QRCODE,Q', 32,62,15,15, $style, 'N');

        $pdf->SetFont('arial','',5);
        $pdf->MultiCell(19, 2, 'FIRST QR', 1, 'C',false, 0, 5, 78, true, 0, false, true, 0, 'T', false);
        $pdf->MultiCell(19, 2, 'SECOND QR', 1, 'C',false, 0, 30, 78, true, 0, false, true, 0, 'T', false);

QR Codes

怎么解决?

谢谢

php pdf printing qr-code tcpdf
1个回答
0
投票

确保第二个qrcode没有外推页面边距。

您可以使用以下方法修改页边距:

    $pdf->SetMargins(0,0, 0);
    $pdf->SetHeaderMargin(0);
    $pdf->SetFooterMargin(0);
© www.soinside.com 2019 - 2024. All rights reserved.