예제 #1
0
파일: Footer.php 프로젝트: roojs/pear
 /**
  * Add a Image Element
  * 
  * @param string $src
  * @param mixed $style
  * @return PHPWord_Section_Image
  */
 public function addImage($src, $style = null)
 {
     require_once __DIR__ . '/Image.php';
     $image = new Document_Word_Writer_Section_Image($src, $style);
     if (!is_null($image->getSource())) {
         $rID = Document_Word_Writer_Media::addFooterMediaElement($this->_footerCount, $src);
         $image->setRelationId($rID);
         $this->_elementCollection[] = $image;
         return $image;
     } else {
         trigger_error('Src does not exist or invalid image type.', E_ERROR);
     }
 }
예제 #2
0
파일: Cell.php 프로젝트: roojs/pear
 /**
  * Add a Image Element
  * 
  * @param string $src
  * @param mixed $style
  * @return PHPWord_Section_Image
  */
 public function addImage($src, $style = null)
 {
     require_once __DIR__ . '/../Image.php';
     $image = new Document_Word_Writer_Section_Image($src, $style);
     if (!is_null($image->getSource())) {
         require_once __DIR__ . '/../../Media.php';
         if ($this->_insideOf == 'section') {
             $rID = Document_Word_Writer_Media::addSectionMediaElement($src, 'image');
         } elseif ($this->_insideOf == 'header') {
             $rID = Document_Word_Writer_Media::addHeaderMediaElement($this->_pCount, $src);
         } elseif ($this->_insideOf == 'footer') {
             $rID = Document_Word_Writer_Media::addFooterMediaElement($this->_pCount, $src);
         }
         $image->setRelationId($rID);
         $this->_elementCollection[] = $image;
         return $image;
     } else {
         trigger_error('Source does not exist or unsupported image type.');
     }
 }
예제 #3
0
파일: Section.php 프로젝트: roojs/pear
 public static function staticAddImage($th, $src, $style = null)
 {
     require_once __DIR__ . '/Section/Image.php';
     require_once __DIR__ . '/Media.php';
     $image = new Document_Word_Writer_Section_Image($src, $style);
     if (is_null($image->getSource())) {
         return false;
         trigger_error('Source does not exist or unsupported image type.');
     }
     $rID = Document_Word_Writer_Media::addSectionMediaElement($src, 'image');
     $image->setRelationId($rID);
     $th->_elementCollection[] = $image;
     return $image;
 }
예제 #4
0
파일: Header.php 프로젝트: roojs/pear
 /**
  * Add a Watermark Element
  * 
  * @param string $src
  * @param mixed $style
  * @return PHPWord_Section_Image
  */
 public function addWatermark($src, $style = null)
 {
     $image = new Document_Word_Writer_Section_Image($src, $style, true);
     if (!is_null($image->getSource())) {
         $rID = Document_Word_Writer_Media::addHeaderMediaElement($this->_headerCount, $src);
         $image->setRelationId($rID);
         $this->_elementCollection[] = $image;
         return $image;
     } else {
         trigger_error('Src does not exist or invalid image type.', E_ERROR);
     }
 }