/** * Add a Watermark Element * * @param string $src * @param mixed $style * @return PHPWord_Section_Image */ public function addWatermark($src, $style = null) { $image = new PHPWord_Section_Image($src, $style, true); if (!is_null($image->getSource())) { $rID = PHPWord_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); } }
/** * Add a Image Element * * @param string $src * @param mixed $style * @return PHPWord_Section_Image */ public function addImage($src, $style = null) { $image = new PHPWord_Section_Image($src, $style); if (!is_null($image->getSource())) { $rID = PHPWord_Media::addSectionMediaElement($src, 'image'); $image->setRelationId($rID); $this->_elementCollection[] = $image; return $image; } else { trigger_error('Source does not exist or unsupported image type.'); } }