/** * HTML line renderer * * @param ReportHtml $renderer */ public function render($renderer) { if ($this->x1 == '.') { $this->x1 = $renderer->getX(); } if ($this->y1 == '.') { $this->y1 = $renderer->getY(); } if ($this->x2 == '.') { $this->x2 = $renderer->getRemainingWidth(); } if ($this->y2 == '.') { $this->y2 = $renderer->getY(); } // Vertical line if ($this->x1 == $this->x2) { echo "<div style=\"position:absolute;overflow:hidden;border-", $renderer->alignRTL, ":solid black 1pt;", $renderer->alignRTL, ":", $this->x1, "pt;top:", $this->y1 + 1, "pt;width:1pt;height:", $this->y2 - $this->y1, "pt;\"> </div>\n"; } // Horizontal line if ($this->y1 == $this->y2) { echo "<div style=\"position:absolute;overflow:hidden;border-top:solid black 1pt;", $renderer->alignRTL, ":", $this->x1, "pt;top:", $this->y1 + 1, "pt;width:", $this->x2 - $this->x1, "pt;height:1pt;\"> </div>\n"; } // Keep max Y updated // One or the other will be higher... lasy mans way... $renderer->addMaxY($this->y1); $renderer->addMaxY($this->y2); }
/** * Image renderer * * @param ReportHtml $renderer */ public function render($renderer) { global $lastpicbottom, $lastpicpage, $lastpicleft, $lastpicright; // Get the current positions if ($this->x == ".") { $this->x = $renderer->getX(); } if ($this->y == ".") { //-- first check for a collision with the last picture if (isset($lastpicbottom)) { if ($renderer->pageNo() == $lastpicpage && $lastpicbottom >= $renderer->getY() && $this->x >= $lastpicleft && $this->x <= $lastpicright) { $renderer->setY($lastpicbottom + $renderer->cPadding * 2); } } $this->y = $renderer->getY(); } // Image alignment switch ($this->align) { case "L": echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:left;\">\n"; echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n"; break; case "C": echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:center;\">\n"; echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n"; break; case "R": echo "<div style=\"position:absolute;top:", $this->y, "pt;left:0pt;width:", $renderer->getRemainingWidth(), "pt;text-align:right;\">\n"; echo "<img src=\"", $this->file, "\" style=\"width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n</div>\n"; break; default: echo "<img src=\"", $this->file, "\" style=\"position:absolute;", $renderer->alignRTL, ":", $this->x, "pt;top:", $this->y, "pt;width:", $this->width, "pt;height:", $this->height, "pt;\" alt=\"\">\n"; } $lastpicpage = $renderer->pageNo(); $lastpicleft = $this->x; $lastpicright = $this->x + $this->width; $lastpicbottom = $this->y + $this->height; // Setup for the next line if ($this->line == "N") { $renderer->setY($lastpicbottom); } // Keep max Y updated $renderer->addMaxY($lastpicbottom); }