I have been trying to convert PDF to JPG images using ImageMagick on CodeIgniter, but the produced image is in low quality and always having black background for some reason (while PDF isn't).
The code I'm using
public function converter($pdf){
$this->load->library('image_lib');
$config = array(
'image_library' => 'imagemagick',
'library_path' => '/usr/bin/convert',
'source_image' => "./pdf/".$pdf,
'new_image' => "./images/a.jpg",
'maintain_ratio' => true,
'width' => 980,
'quality' => '90%',
);
$this->image_lib->initialize( $config );
if ( $this->image_lib->resize( ) ) {
$this->image_lib->clear( );
}
}
Anybody have any idea about what does seem to be wrong here?