PHP Class PHPRtfLite_Image

Author: Denis Slaveckij ([email protected])
Author: Steffen Zeidler ([email protected])
Inheritance: implements PHPRtfLite_Freeable
Mostrar archivo Open project: phprtflite/phprtflite Class Usage Examples

Protected Properties

Property Type Description
$_border PHPRtfLite_Border rtf border
$_height float resize to height
$_imageHeight integer original image height
$_imageRtfType string image rtf type
$_imageWidth float original image width
$_isMissing boolean flag, true if image file is missing
$_parFormat PHPRtfLite_ParFormat par format
$_rtf PHPRtfLite rtf document
$_stream resource stream as php resource
$_width float resize to width

Public Methods

Method Description
__construct ( PHPRtfLite $rtf, resource $stream, float $width = null, float $height = null ) constructor
__destruct ( ) destructor - closes stream
createFromFile ( PHPRtfLite $rtf, string $file, float $width = null, float $height = null ) : PHPRtfLite_Image creates rtf image from file
createFromString ( PHPRtfLite $rtf, string $string, string $type, float $width = null, float $height = null ) : PHPRtfLite_Image creates rtf image from string
free ( )
getBorder ( ) : PHPRtfLite_Border gets border
getHeight ( ) : float gets image height
getParFormat ( ) : PHPRtfLite_ParFormat gets paragraph format for image
getWidth ( ) : float gets image width
isMissing ( )
render ( ) renders rtf image for rtf document
setBorder ( PHPRtfLite_Border $border ) sets border
setHeight ( float $height ) sets image height
setIsMissing ( )
setParFormat ( PHPRtfLite_ParFormat $parFormat ) sets paragraph format for image
setWidth ( float $width ) sets image width

Protected Methods

Method Description
getImageTypeAsRtf ( ) : string gets image rtf type
setImageHeight ( float $height ) sets image original height
setImageWidth ( float $width ) sets image original width
writeIntoRtfStream ( integer $startFrom ) writes image into rtf stream

Private Methods

Method Description
create ( PHPRtfLite $rtf, resource $stream, string $type, float $width, float $height ) : PHPRtfLite_Image_Wmf | PHPRtfLite_Image_Gd | PHPRtfLite_Image factory method creates rtf image from stream
createMissingImage ( PHPRtfLite $rtf, float $width, float $height ) : PHPRtfLite_Image_Gd creates a missing image instance
getImageRtfHeight ( ) : integer gets rtf image height
getImageRtfWidth ( ) : integer gets rtf image width
getMissingImage ( ) adds rtf image code to show that the file is missing

Method Details

__construct() public method

constructor
public __construct ( PHPRtfLite $rtf, resource $stream, float $width = null, float $height = null )
$rtf PHPRtfLite
$stream resource
$width float optional
$height float optional

__destruct() public method

destructor - closes stream
public __destruct ( )

createFromFile() public static method

creates rtf image from file
public static createFromFile ( PHPRtfLite $rtf, string $file, float $width = null, float $height = null ) : PHPRtfLite_Image
$rtf PHPRtfLite
$file string
$width float optional
$height float optional
return PHPRtfLite_Image

createFromString() public static method

creates rtf image from string
public static createFromString ( PHPRtfLite $rtf, string $string, string $type, float $width = null, float $height = null ) : PHPRtfLite_Image
$rtf PHPRtfLite
$string string
$type string (represented by class constants)
$width float optional
$height float optional
return PHPRtfLite_Image

free() public method

public free ( )

getBorder() public method

gets border
public getBorder ( ) : PHPRtfLite_Border
return PHPRtfLite_Border

getHeight() public method

gets image height
public getHeight ( ) : float
return float

getImageTypeAsRtf() protected method

gets image rtf type
protected getImageTypeAsRtf ( ) : string
return string

getParFormat() public method

gets paragraph format for image
public getParFormat ( ) : PHPRtfLite_ParFormat
return PHPRtfLite_ParFormat

getWidth() public method

gets image width
public getWidth ( ) : float
return float

isMissing() public method

public isMissing ( )

render() public method

renders rtf image for rtf document
public render ( )

setBorder() public method

sets border
public setBorder ( PHPRtfLite_Border $border )
$border PHPRtfLite_Border

setHeight() public method

sets image height
public setHeight ( float $height )
$height float if not defined image is displayed by it's width.

setImageHeight() protected method

sets image original height
protected setImageHeight ( float $height )
$height float

setImageWidth() protected method

sets image original width
protected setImageWidth ( float $width )
$width float

setIsMissing() public method

public setIsMissing ( )

setParFormat() public method

sets paragraph format for image
public setParFormat ( PHPRtfLite_ParFormat $parFormat )
$parFormat PHPRtfLite_ParFormat

setWidth() public method

sets image width
public setWidth ( float $width )
$width float if not defined image is displayed by it's height.

writeIntoRtfStream() protected method

writes image into rtf stream
protected writeIntoRtfStream ( integer $startFrom )
$startFrom integer

Property Details

$_border protected_oe property

rtf border
protected PHPRtfLite_Border $_border
return PHPRtfLite_Border

$_height protected_oe property

resize to height
protected float $_height
return float

$_imageHeight protected_oe property

original image height
protected int $_imageHeight
return integer

$_imageRtfType protected_oe property

image rtf type
protected string $_imageRtfType
return string

$_imageWidth protected_oe property

original image width
protected float $_imageWidth
return float

$_isMissing protected_oe property

flag, true if image file is missing
protected bool $_isMissing
return boolean

$_parFormat protected_oe property

par format
protected PHPRtfLite_ParFormat $_parFormat
return PHPRtfLite_ParFormat

$_rtf protected_oe property

rtf document
protected PHPRtfLite $_rtf
return PHPRtfLite

$_stream protected_oe property

stream as php resource
protected resource $_stream
return resource

$_width protected_oe property

resize to width
protected float $_width
return float