7 class XML_SvgToPDF_Rect extends XML_SvgToPDF_Base {
11 var $nonprintable = false;
14 function writePDF($pdf,$data) {
16 //print_r(array("rect:", $this->x , $this->y , ':', $this->xx, $this->yy));
18 $x = $this->x + @$this->xx;
19 $y = $this->y + @$this->yy;
23 $pdf->setLineWidth($this->style['stroke-width']);
24 $f = $this->toColor($this->style['fill']);
26 $pdf->setFillColor($f[0],$f[1],$f[2]);
29 $l = $this->toColor(@$this->style['stroke']);
31 $pdf->setDrawColor($l[0],$l[1],$l[2]);
33 // no fill, no line = dont draw...
37 XML_SvgToPDF::debug("RECT:" .($x/ 3.543307).',' .($y/ 3.543307). ','
38 .($this->width/ 3.543307).',' . ($this->height/ 3.543307));
39 $pdf->rect($x/ 3.543307,$y/ 3.543307,
40 $this->width/ 3.543307,$this->height/ 3.543307,($l ? 'D' : ''). ($f ? 'F' : ''));
47 function toColor($color) {
48 if (!$color || ($color == 'none')) {
52 hexdec(substr($color,1,2)),
53 hexdec(substr($color,3,2)),
54 hexdec(substr($color,5,2)));