Example #1
0
 /**
  * Draw a line of text at the specified position.
  *
  * @param string $text
  * @param float $x
  * @param float $y
  * @throws Zend_Pdf_Exception
  */
 public function drawText($text, $x, $y)
 {
     if ($this->_font === null) {
         throw new Zend_Pdf_Exception('Font has not been set');
     }
     $this->_addProcSet('Text');
     $textObj = new Zend_Pdf_Element_String($this->_font->applyEncoding($text));
     $xObj = new Zend_Pdf_Element_Numeric($x);
     $yObj = new Zend_Pdf_Element_Numeric($y);
     $this->_contents .= "BT\n" . $xObj->toString() . ' ' . $yObj->toString() . " Td\n" . $textObj->toString() . " Tj\n" . "ET\n";
 }