public function drawPolygon($points, $fill = true)
{
$i = 1;
$polygon = null;
foreach ($points as $coord) {
if ($i == 1) {
$polygon .= $coord['x'] . " " . $coord['y'] . " m\n";
} else {
if ($i <= count($points)) {
$polygon .= $coord['x'] . " " . $coord['y'] . " l\n";
}
}
$i++;
}
$polygon .= "h\n";
$co_index = $this->getContentObject();
$this->objects[$co_index]->setStream("\n{$polygon}\n" . $this->setStyle($fill) . "\n");
return $this;
}