我正在使用TCPDF和FPDI的橋接器。我遇到的問題是,當我使用startTransaction()
我得到以下錯誤:有沒有辦法在使用FPDI進行擴展時使用TCPDF中的事務?
TCPDF ERROR: Cannot access protected property FPDI:$numpages/Undefined property: FPDI::$numpages
和腳本結束(因爲TCPDF ::錯誤()方法的模具)。
這裏是我使用的代碼:
$pdf = new FPDI();
// add a page
$pdf->AddPage();
$pdf->startTransaction();
$pdf->Cell(0, 0, 'blah blah blah');
$pdf->rollbackTransaction();
$pdf->Output(. time() . '.pdf', 'D');
如果我將其更改爲:
$pdf = new FPDI();
// add a page
$pdf->AddPage();
$pdf->Cell(0, 0, 'blah blah blah');
$pdf->Output(. time() . '.pdf', 'D');
它工作正常。
無論如何要讓它們一起使用並使用TCPDF的事務嗎?