Author: Denis Slaveckij (sinedas@gmail.com)
Author: Steffen Zeidler (sigma_z@sigma-scripts.de)
Inheritance: implements PHPRtfLite_Freeable
Exemple #1
0
 /**
  * adds image to element container.
  *
  * @param string                $string     name of image file.
  * @param string                $type       class constants of PHPRtfLite_Image: TYPE_JPEG, TYPE_PNG, TYPE_WMF
  * @param PHPRtfLite_ParFormat  $parFormat  paragraph format, ff null image will appear in the same paragraph.
  * @param float                 $width      if null image is displayed by it's height.
  * @param float                 $height     if null image is displayed by it's width.
  *   If boths parameters are null, image is displayed as it is.
  *
  * @return PHPRtfLite_Image
  */
 public function addImageFromString($string, $type, PHPRtfLite_ParFormat $parFormat = null, $width = null, $height = null)
 {
     $image = PHPRtfLite_Image::createFromString($this->_rtf, $string, $type, $width, $height);
     if ($parFormat) {
         $image->setParFormat($parFormat);
     }
     $this->_elements[] = $image;
     return $image;
 }
Exemple #2
0
 /**
  * constructor
  *
  * @param PHPRtfLite    $rtf
  * @param resource      $stream
  * @param float         $width  optional
  * @param float         $height optional
  */
 public function __construct(PHPRtfLite $rtf, $stream, $width = null, $height = null)
 {
     parent::__construct($rtf, $stream, $width, $height);
     $this->_imageRtfType = '\\wmetafile8';
     $this->setImageDimension();
 }
Exemple #3
0
 /**
  *
  */
 public function testRenderMissingImageFile()
 {
     $image = PHPRtfLite_Image::createFromFile($this->_rtf, '');
     $this->assertTrue($image->isMissing());
 }