Page 1 of 1

Deskew in PDF or TIF

Posted: 2012-07-03T12:47:19-07:00
by jota_sp_84
I need to do Deskew multipage PDF images, how do or else using the imagick for PHP?

Re: Deskew in PDF or TIF

Posted: 2012-07-03T13:06:05-07:00
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.

Re: Deskew in PDF or TIF

Posted: 2012-07-03T13:38:50-07:00
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.

Re: Deskew in PDF or TIF

Posted: 2012-07-03T14:22:44-07:00
by Bonzo
What is the error?
Do you have ghostscript installed?