I an using TCPDF to create a PDF output. At the left of the page, I'd like a couple of cells or blocks on top of each other with rotated text. If the text is larger than the width (or actual height, when rotated), the text should be cut off.
I can make a unrotated box in a certain size at a certain position by doing this:
$roleheight=160/count($rolenames);
$x=4;
$y=18;
$w=$roleheight;
$h=20;
$text="The quick brown fox jumps over the lazy dog, The quick brown fox jumps over the lazy dog, The quick brown fox jumps over the lazy dog";
$pdf->MultiCell($w,$h,"",0,"J",true,0,4,18,true,0,false,true,5,'T',false);
$pdf->StartTransform();
$pdf->Rect($x, $y, $w, $h, 'CNZ');
$pdf->writeHTMLCell($w, $h, $x, $y, $text,0,0,false,true,"",false);
$pdf->StopTransform();
I can make a rotated box at a certain size by doing this:
$pdf->StartTransform();
$pdf->Rotate(90);
$pdf->MultiCell($w,$h,$text,0,"J",true,0,$x,$y-50,true,0,false,true,5,'T',false);
$pdf->StopTransform();
But the second box does not honor my position, and the first box cannot be rotated.
I tried adding $pdf->Rotate(90); to the first box before the Rect, between Rect and writeHTMLCell and after writeHTMLCell, but no luck
I tried alter the $x and $y of the second box, by adding or substracting a number (e.g. 100), but that places the box at a very unexpected location.
If I outcomment the FIRST box, the second box won't appear either. So somehow the position of box 2 is inherited from box 1. But how and why?