7 class XML_SvgToPDF_Rect extends XML_SvgToPDF_Base {
11 var $nonprintable = false;
13 function writePDF($pdf,$data) {
15 //print_r(array("rect:", $this->x , $this->y , ':', $this->xx, $this->yy));
17 $x = $this->x + @$this->xx;
18 $y = $this->y + @$this->yy;
22 $pdf->setLineWidth($this->style['stroke-width']);
23 $f = $this->toColor($this->style['fill']);
25 $pdf->setFillColor($f[0],$f[1],$f[2]);
28 $l = $this->toColor(@$this->style['stroke']);
30 $pdf->setDrawColor($l[0],$l[1],$l[2]);
32 // no fill, no line = dont draw...
36 XML_SvgToPDF::debug("RECT:" .($x/ 3.543307).',' .($y/ 3.543307). ','
37 .($this->width/ 3.543307).',' . ($this->height/ 3.543307));
38 $pdf->rect($x/ 3.543307,$y/ 3.543307,
39 $this->width/ 3.543307,$this->height/ 3.543307,($l ? 'D' : ''). ($f ? 'F' : ''));
46 function toColor($color) {
47 if (!$color || ($color == 'none')) {
51 hexdec(substr($color,1,2)),
52 hexdec(substr($color,3,2)),
53 hexdec(substr($color,5,2)));