SIMITGROUP / phpjasperxml

This is a php wysiwyg report library
BSD 3-Clause "New" or "Revised" License
43 stars 46 forks source link

text rotation #53

Closed 12gods closed 2 years ago

12gods commented 4 years ago

load file "rotate.jrxml" i want to rotate a text label but when i use the parameter Left the export not working

the problem is on variables pdf->k and pdf->h because there are null is there any solution?

f( $angle!=0 ) { $angle=M_PI/180; $c=cos($angle); $s=sin($angle); $cx=$x$this->pdf->k; $cy=($this->pdf->h-$y)*$this->pdf->k; $this->pdf->_out(sprintf('q %.5f %.5f %.5f %.5f %.2f %.2f cm 1 0 0 1 %.2f %.2f cm', $c, $s, -$s, $c, $cx, $cy, -$cx, -$cy)); }

kstan79 commented 4 years ago

how your orientation/degree?

12gods commented 4 years ago

as my sample i use static text and the orientation is rotation="Left"

`

            <box>
                <leftPen lineWidth="1.0"/>
                <bottomPen lineWidth="1.0"/>
                <rightPen lineWidth="1.0"/>
            </box>
            <textElement textAlignment="Center" rotation="Left">
                <font pdfFontName="" isPdfEmbedded="true" fontName="Arial" size="5"/>
            </textElement>
            <text><![CDATA[code]]></text>
        </staticText>`
kstan79 commented 4 years ago

hi, i'm tried using your label it seems draw text as expected, but the border seems not cover the text correctly

Screenshot 2019-10-21 at 10 01 54 PM

This issue I will leave it open, however wont fix immediately. To work arround you can create another rectangle to cover the text.

kstan79 commented 2 years ago

this repository closed, use new repository with new code base instead: https://github.com/SIMITGROUP/phplibs