TCPDF icon indicating copy to clipboard operation
TCPDF copied to clipboard

Footer breaks transformation

Open Harmageddon opened this issue 6 years ago • 1 comments

If we use transforms and a page is ending inside a transformed part, the transformation is applied to the footer, but seems to be stopped afterwards, so it doesn't continue on the next page.

Simplified code example:

// Start transform
$pdf->StartTransform();
$pdf->Rotate(15);

// Output some multi-line text that causes a page break.
$pdf->writeHTMLCell(0, 0, '', 260, $html, 0, 1, 0, true, '', true); // <-- Page break within here

// Stop transform
$pdf->StopTransform();

See the slightly changed version of example001.php here. This results in a PDF like example_001.pdf. You see that there is a rotated text at the end of page 1. The footer is rotated along with the text (but shouldn't be, because it has no own rotation). The second part of the text on page 2 instead is not rotated at all (but should be, because it's inside the transformation).

Is there any way to save the whole transformation stack before printing the footer and restoring it afterwards?

Harmageddon avatar Jan 05 '20 15:01 Harmageddon

Thank you for reporting this. TCPDF 6 is now a legacy project and is officially deprecated, so no further fixes or features will be merged into this repository. As part of this transition, we are closing older issues. Please migrate to tc-lib-pdf and, if the same problem still occurs there, open a new issue with updated reproduction steps. For more context, see the pinned announcement: Thank You - and the Future of TCPDF.

nicolaasuni avatar May 30 '26 18:05 nicolaasuni