PHP | Imagick getPage() Function
Last Updated :
26 Nov, 2019
The Imagick::getPage() function is an inbuilt function in PHP which is used to return the geometry of page associated with Imagick object in associative array format.
Syntax:
array Imagick::getPage( void )
Parameters:This function does not accept any parameter.
Return Value: This function returns an associative array with the keys “width”, “height”, “x”, and “y”.
Errors/Exceptions: This function throws ImagickException on error.
Below programs illustrate the Imagick::getPage() function in PHP:
Program 1:
<?php
$imagick = new Imagick(
$geometry = $imagick ->getPage();
print_r( $geometry );
?>
|
Output:
Array ( [width] => 0 [height] => 0 [x] => 0 [y] => 0 )
Program 2:
<?php
$imagick = new Imagick(
$imagick ->setPage(200, 300, 0, 0);
$geometry = $imagick ->getPage();
print_r( $geometry );
?>
|
Output:
Array ( [width] => 200 [height] => 300 [x] => 0 [y] => 0 )
Reference: https://www.php.net/manual/en/imagick.getpage.php
Share your thoughts in the comments
Please Login to comment...