Hank Cape - 2016-02-02

Hello

I have tried to understand how the text rotation happens with the HTML cell but haven't been able to get it working. I want to rotate text some 45 degrees to make the table fit in a page.

I build whole the table and then just run WriteHTML of the code.

My (relevant) code is:

$params = $this->pdf->serializeTCPDFtagParameters(array(45));
 foreach($this->data['order'] as $m) {
        $html.="<td width=\"5%\">";
        $html.='<tcpdf method="Rotate" params="' $params . '">' . $m . '</tcpdf>';
        $html.="</td>";
 }

I have also tried to use this code:

$params = $this->pdf->serializeTCPDFtagParameters(array(45));
 foreach($this->data['order'] as $m) {
        $html.="<td width=\"5%\">";
        $this->pdf->StartTransformation();
        $html.='<tcpdf method="Rotate" params="' $params . '">' . $m . '</tcpdf>';
        $this->pdf->StopTransformation();
        $html.="</td>";
 }

with equal result.

Now, my questions are:
a) Is my plan to build the whole html first and then print the output out fine? The table is quite complicated and relies on stylesheet (which I probably should send for every WriteHTML, right? Also the table would be broken for each separate call, which might pose a problem for TCPDF?
b) If a) is OK, what is the problem with my approach. I feel that the StartTransformation & StopTransformation are executed outside the rotation when the writeHTML is delayed for later.

Please bear with me and give some advice how to proceed.

with my best regards

HC

 

Last edit: Hank Cape 2016-02-02