PHP Class Pop\Pdf\Parser\Image

Author: Nick Sagona, III ([email protected])
Show file Open project: nicksagona/PopPHP Class Usage Examples

Protected Properties

Property Type Description
$convertedImage string Converted image path
$imageData string Image data
$imageDataLength integer Image data length
$img mixed Image object
$index array PDF next index
$objects array Image objects
$origH integer Image original height
$origW integer Image original width
$scaledImage string Scaled image path
$stream string Stream string
$x array Image X Coordinate
$xobject string XObject string
$y array Image Y Coordinate

Public Methods

Method Description
__construct ( string $img, integer $x, integer $y, integer $i, mixed $scl = null, boolean $preserveRes = false ) : Image Constructor
getObjects ( ) : array Method to get the image objects.
getOrigH ( ) : string Method to get the original image height.
getOrigW ( ) : string Method to get the original image width.
getScaledDimensions ( mixed $scl, integer $origW, integer $origH ) : array Method to get scaled dimensions of the image, while preserving the resolution.
getStream ( ) : string Method to get the stream string.
getXObject ( ) : string Method to get the xobject string.

Protected Methods

Method Description
convertImage ( ) : void Method to convert the image.
parseJpeg ( ) : void Method to parse the JPEG image.
parsePng ( ) : void Method to parse the PNG image.
readInt ( string $data ) : integer Method to read an unsigned integer.
scaleImage ( mixed $scl ) : void Method to scale or resize the image.

Method Details

__construct() public method

Instantiate a image parser object to be used by Pop_Pdf.
public __construct ( string $img, integer $x, integer $y, integer $i, mixed $scl = null, boolean $preserveRes = false ) : Image
$img string
$x integer
$y integer
$i integer
$scl mixed
$preserveRes boolean
return Image

convertImage() protected method

Method to convert the image.
protected convertImage ( ) : void
return void

getObjects() public method

Method to get the image objects.
public getObjects ( ) : array
return array

getOrigH() public method

Method to get the original image height.
public getOrigH ( ) : string
return string

getOrigW() public method

Method to get the original image width.
public getOrigW ( ) : string
return string

getScaledDimensions() public static method

Method to get scaled dimensions of the image, while preserving the resolution.
public static getScaledDimensions ( mixed $scl, integer $origW, integer $origH ) : array
$scl mixed
$origW integer
$origH integer
return array

getStream() public method

Method to get the stream string.
public getStream ( ) : string
return string

getXObject() public method

Method to get the xobject string.
public getXObject ( ) : string
return string

parseJpeg() protected method

Method to parse the JPEG image.
protected parseJpeg ( ) : void
return void

parsePng() protected method

Method to parse the PNG image.
protected parsePng ( ) : void
return void

readInt() protected method

Method to read an unsigned integer.
protected readInt ( string $data ) : integer
$data string
return integer

scaleImage() protected method

Method to scale or resize the image.
protected scaleImage ( mixed $scl ) : void
$scl mixed
return void

Property Details

$convertedImage protected property

Converted image path
protected string $convertedImage
return string

$imageData protected property

Image data
protected string $imageData
return string

$imageDataLength protected property

Image data length
protected int $imageDataLength
return integer

$img protected property

Image object
protected mixed $img
return mixed

$index protected property

PDF next index
protected array $index
return array

$objects protected property

Image objects
protected array $objects
return array

$origH protected property

Image original height
protected int $origH
return integer

$origW protected property

Image original width
protected int $origW
return integer

$scaledImage protected property

Scaled image path
protected string $scaledImage
return string

$stream protected property

Stream string
protected string $stream
return string

$x protected property

Image X Coordinate
protected array $x
return array

$xobject protected property

XObject string
protected string $xobject
return string

$y protected property

Image Y Coordinate
protected array $y
return array