Is there a way to use the transactions in TCPDF when extending it with FPDI?

Posted by Darryl Hein on Stack Overflow See other posts from Stack Overflow or by Darryl Hein
Published on 2010-03-31T21:57:44Z Indexed on 2010/03/31 22:03 UTC
Read the original article Hit count: 524

Filed under:
|
|

I am using TCPDF with FPDI's bridge. The issue I'm having is that as soon as I use the startTransaction() I get the following error:

TCPDF ERROR: Cannot access protected property FPDI:$numpages / Undefined property: FPDI::$numpages

and the script ends (because of the die in the TCPDF::Error() method).

Here is the code I'm using:

$pdf = new FPDI();

// add a page
$pdf->AddPage();

$pdf->startTransaction();
$pdf->Cell(0, 0, 'blah blah blah');
$pdf->rollbackTransaction();

$pdf->Output( . time() . '.pdf', 'D');

If I change it to:

$pdf = new FPDI();

// add a page
$pdf->AddPage();

$pdf->Cell(0, 0, 'blah blah blah');

$pdf->Output( . time() . '.pdf', 'D');

it works fine.

Is there anyway to make them work together and use TCPDF's transactions?

© Stack Overflow or respective owner

Related posts about tcpdf

Related posts about fpdi