--- /dev/null
+<?php
+
+/* output a rectangle
+
+*/
+
+class XML_SvgToPDFAlt_Rect extends XML_SvgToPDFAlt_Base {
+ function writePDF($pdf,$data) {
+ $x = $this->x + @$this->xx;
+ $y = $this->y + @$this->yy;
+
+
+
+ $pdf->setLineWidth($this->style['stroke-width']);
+ $f = $this->toColor($this->style['fill']);
+ if ($f) {
+ $pdf->setFillColor($f[0],$f[1],$f[2]);
+ }
+
+ $l = $this->toColor(@$this->style['stroke']);
+ if ($l) {
+ $pdf->setDrawColor($l[0],$l[1],$l[2]);
+ }
+ // no fill, no line = dont draw...
+ if (!$l && !$f) {
+ return;
+ }
+ XML_SvgToPDFAlt::debug("RECT:" .($x/ 3.543307).',' .($y/ 3.543307). ','
+ .($this->width/ 3.543307).',' . ($this->height/ 3.543307));
+ $pdf->rect($x/ 3.543307,$y/ 3.543307,
+ $this->width/ 3.543307,$this->height/ 3.543307,($l ? 'D' : ''). ($f ? 'F' : ''));
+
+
+
+ }
+
+
+ function toColor($color) {
+ if (!$color || ($color == 'none')) {
+ return false;
+ }
+ return array(
+ hexdec(substr($color,1,2)),
+ hexdec(substr($color,3,2)),
+ hexdec(substr($color,5,2)));
+
+ }
+
+
+}
\ No newline at end of file