我正在使用TCPDF和FPDI创建一个新的PDF,并希望在一个整页上添加一个图像(具有alpha透明度) . 奇怪的是,TCPDF有时会创建一个PDF,有时只会崩溃而没有错误(即除了标准的响应头(对于text / html),根本不会产生任何输出 . 它总是取决于我传递给图像的尺寸功能:

$this->Image($markupfile,0,0,120, 50, 'png', '', '', true, 300);

然而,工作(尽管图像太小)

$this->Image($markupfile,0,0,1200, 50, 'png', '', '', true, 300);

才不是 . 原始尺寸为宽度:968px;身高:685px;

require_once "config/sessions_class.php";
    require_once "config/sanitation_class.php";
    require_once('tcpdf/tcpdf.php');
    require_once('tcpdf/config/lang/eng.php');
    require_once('FPDF/fpdi.php');
    require_once('config/settings.php');
    require_once('phpfpm/pdfVersion.php');



 class concatPdf extends FPDI{

     ....

    function concat() {
                $dir = $this->dir;
                $pagecount = $this->setSourceFile($dir.$this->file);
                for ($i = 1; $i <= $pagecount; $i++) {
                    $this->_tplIdx = $this->importPage($i);
                    $s = $this->getTemplatesize($this->_tplIdx);
                    $this->AddPage($s['w'] > $s['h'] ? 'L' : 'P', array($s['w'], $s['h']));
                    $this->useTemplate($this->_tplIdx);
                    $markupfile = "markups/".$this->pdfid."_".$i.".png";
                    if ( file_exists  ($markupfile)) {
                           $this->Image($markupfile,0,0,1020, 50, 'png', '', '', true, 300);

                    }

                 }

     }

     ....

  }



    $filename;
    $pdf = new concatPdf();

    $pdf->setImageScale(1.53);
    $pdf->SetAutoPageBreak(true, 40);
    $pdf->setFontSubsetting(false);
    $pdf->SetMargins(PDF_MARGIN_LEFT, 40, PDF_MARGIN_RIGHT);

    $pdf->concat();

    $pdf->Output('ed_'."filename", 'I');