PHP Class PHPRtfLite_Image

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

Protected Properties

Свойство 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

Méthodes publiques

Méthode 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

Méthodes protégées

Méthode 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

Méthode 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 méthode

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 méthode

destructor - closes stream
public __destruct ( )

createFromFile() public static méthode

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
Résultat PHPRtfLite_Image

createFromString() public static méthode

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
Résultat PHPRtfLite_Image

free() public méthode

public free ( )

getBorder() public méthode

gets border
public getBorder ( ) : PHPRtfLite_Border
Résultat PHPRtfLite_Border

getHeight() public méthode

gets image height
public getHeight ( ) : float
Résultat float

getImageTypeAsRtf() protected méthode

gets image rtf type
protected getImageTypeAsRtf ( ) : string
Résultat string

getParFormat() public méthode

gets paragraph format for image
public getParFormat ( ) : PHPRtfLite_ParFormat
Résultat PHPRtfLite_ParFormat

getWidth() public méthode

gets image width
public getWidth ( ) : float
Résultat float

isMissing() public méthode

public isMissing ( )

render() public méthode

renders rtf image for rtf document
public render ( )

setBorder() public méthode

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

setHeight() public méthode

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

setImageHeight() protected méthode

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

setImageWidth() protected méthode

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

setIsMissing() public méthode

public setIsMissing ( )

setParFormat() public méthode

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

setWidth() public méthode

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

writeIntoRtfStream() protected méthode

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

Property Details

$_border protected_oe property

rtf border
protected PHPRtfLite_Border $_border
Résultat PHPRtfLite_Border

$_height protected_oe property

resize to height
protected float $_height
Résultat float

$_imageHeight protected_oe property

original image height
protected int $_imageHeight
Résultat integer

$_imageRtfType protected_oe property

image rtf type
protected string $_imageRtfType
Résultat string

$_imageWidth protected_oe property

original image width
protected float $_imageWidth
Résultat float

$_isMissing protected_oe property

flag, true if image file is missing
protected bool $_isMissing
Résultat boolean

$_parFormat protected_oe property

par format
protected PHPRtfLite_ParFormat $_parFormat
Résultat PHPRtfLite_ParFormat

$_rtf protected_oe property

rtf document
protected PHPRtfLite $_rtf
Résultat PHPRtfLite

$_stream protected_oe property

stream as php resource
protected resource $_stream
Résultat resource

$_width protected_oe property

resize to width
protected float $_width
Résultat float