7 class XML_SvgToPDFAlt_Rect extends XML_SvgToPDFAlt_Base {
8 function writePDF($pdf,$data) {
9 $x = $this->x + @$this->xx;
10 $y = $this->y + @$this->yy;
14 $pdf->setLineWidth($this->style['stroke-width']);
15 $f = $this->toColor($this->style['fill']);
17 $pdf->setFillColor($f[0],$f[1],$f[2]);
20 $l = $this->toColor(@$this->style['stroke']);
22 $pdf->setDrawColor($l[0],$l[1],$l[2]);
24 // no fill, no line = dont draw...
28 XML_SvgToPDFAlt::debug("RECT:" .($x/ 3.543307).',' .($y/ 3.543307). ','
29 .($this->width/ 3.543307).',' . ($this->height/ 3.543307));
30 $pdf->rect($x/ 3.543307,$y/ 3.543307,
31 $this->width/ 3.543307,$this->height/ 3.543307,($l ? 'D' : ''). ($f ? 'F' : ''));
38 function toColor($color) {
39 if (!$color || ($color == 'none')) {
43 hexdec(substr($color,1,2)),
44 hexdec(substr($color,3,2)),
45 hexdec(substr($color,5,2)));