Exemple #1
0
 /**
  * Draw an image at the specified position on the page.
  *
  * @param Zend_Pdf_Image $image
  * @param float $x1
  * @param float $y1
  * @param float $x2
  * @param float $y2
  */
 public function drawImage(Zend_Pdf_Image $image, $x1, $y1, $x2, $y2)
 {
     $this->_addProcSet('PDF');
     $imageName = $this->_attachResource('XObject', $image->getResource());
     $imageNameObj = new Zend_Pdf_Element_Name($imageName);
     $x1Obj = new Zend_Pdf_Element_Numeric($x1);
     $y1Obj = new Zend_Pdf_Element_Numeric($y1);
     $widthObj = new Zend_Pdf_Element_Numeric($x2 - $x1);
     $heightObj = new Zend_Pdf_Element_Numeric($y2 - $y1);
     $this->_contents .= "q\n" . '1 0 0 1 ' . $x1Obj->toString() . ' ' . $y1Obj->toString() . " cm\n" . $widthObj->toString() . ' 0 0 ' . $heightObj->toString() . " 0 0 cm\n" . $imageNameObj->toString() . " Do\n" . "Q\n";
 }