Deskew in PDF or TIF

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
jota_sp_84
Posts: 3
Joined: 2012-05-11T06:51:02-07:00
Authentication code: 13

Deskew in PDF or TIF

Post by jota_sp_84 »

I need to do Deskew multipage PDF images, how do or else using the imagick for PHP?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Deskew in PDF or TIF

Post by Bonzo »

I have not tried a multipage pdf but the method for one page would be:

Code: Select all

<?php  
$im = new Imagick('text.pdf'); 
$im->deskewImage( 80 ); 
$im->writeImage( 'deskew.pdf' ); 
$im->destroy(); 
 ?> 
You might have to write a loop to do each page singularly.
jota_sp_84
Posts: 3
Joined: 2012-05-11T06:51:02-07:00
Authentication code: 13

Re: Deskew in PDF or TIF

Post by jota_sp_84 »

The file test is single page
I tried using the code you gave but it's just an error on the line

Code: Select all

 $im->deskewImage (80); 
could you tell me what to do to fix the problem?

Bonzo wrote:I have not tried a multipage pdf but the method for one page would be:

Code: Select all

<?php  
$im = new Imagick('text.pdf'); 
$im->deskewImage( 80 ); 
$im->writeImage( 'deskew.pdf' ); 
$im->destroy(); 
 ?> 
You might have to write a loop to do each page singularly.
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Deskew in PDF or TIF

Post by Bonzo »

What is the error?
Do you have ghostscript installed?
Post Reply