Ejemplo n.º 1
0
 public function copyPage()
 {
     $copy = new Core_Pdf_Page($this);
     $copy->setFont($this->getFont(), $this->getFontSize());
     $copy->setMargins($this->getMargins());
     $copy->setPaddings($this->getPaddings());
     return $copy;
 }
Ejemplo n.º 2
0
 private function _renderText(Core_Pdf_Page $page, $posX, $posY)
 {
     if (!$this->_text) {
         return;
     }
     $page->setFont($this->_font, $this->_fontSize);
     if ($this->_color) {
         $page->setFillColor($this->_color);
     }
     if (count($this->_text['lines']) > 1) {
         $lineHeight = $page->getFontHeight() + $this->_textLineSpacing;
         $yInc = $posY - $this->_textLineSpacing;
         $this->_vAlign = Core_Pdf::TOP;
         foreach ($this->_text['lines'] as $line) {
             $page->drawText($line, $this->_getTextPosX($posX), $this->_getTextPosY($page, $yInc));
             $yInc -= $lineHeight;
         }
     } else {
         //write single line of text
         $page->drawText($this->_text['text'], $this->_getTextPosX($posX), $this->_getTextPosY($page, $posY));
     }
     //reset style
     $page->setStyle($page->getDefaultStyle());
 }