php tcpdf 图片出不来,PHP:$ pdf->图像崩溃(TCPDF)

我正在使用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');

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值