Rotate Text using TCPDF

If you are rotating the text via customising one of our supplied .phtml template files

<?php
    $rotateParams = [180, '', ''];
?>
<tcpdf method="StartTransform" />
<tcpdf method="Rotate" <?= $block->getEncodedParams($rotateParams) ?> />
<div>Rotated text</div>
<tcpdf method="StopTransform" />

From a class where \Fooman\PdfCore\Model\Tcpdf\Pdf is available like in
vendor/fooman/pdfcore-m2/src/Model/PdfRenderer.php
(or the emitted fooman_pdfcore_before_write_html event )

        $this->pdf->StartTransform();
        $this->pdf->Rotate(180);
        $this->pdf->writeHTML('<div>Rotated Text</div>', false);
        $this->pdf->StopTransform();

Still need help? Contact Us Contact Us