Page 1 of 1

Quality PDF>Image

Posted: 2009-03-19T06:16:54-07:00
by Rebel
Hello,

I am using ghostscript and imagemagicK to convert pdf files to images,
but it looks like the images get resized :S?
and the quality is really poor.

Do you know how i can change this.
i have tried all the filters en quality option etc.

my script:

Code: Select all

$strPDF = "Flash.pdf";
//exec("/usr/bin/convert " . escapeshellarg($strPDF) . " -colorspace RGB -quality 100 " . escapeshellarg("map/flash.jpg"));

`convert Flash.pdf -colorspace RGB -quality 100% bestand.png`;
echo '<img src="bestand.png">';
?>

I am also looking for something to check how much pages the pdf has? i read something about ping?

Re: Quality PDF>Image

Posted: 2009-03-19T07:06:53-07:00
by magick
To get high quality rendered PDF pages try supersampling:
  • convert -density 400 image.pdf -resize 25% image.png

Re: Quality PDF>Image

Posted: 2009-03-19T07:50:08-07:00
by Rebel
Wow thanks alot.

The script is really powerfull :O

nice build i need to say!

Do you also know about how to count the PDF pages. (i need it for echoing the images afterwords ;))
or do i need to go to someone ho knowes ghostscript?

Thanks anyway for the quality issue

Re: Quality PDF>Image

Posted: 2010-03-25T18:53:43-07:00
by caribbean pirate
Use PDF to Images Converter to convert your PDF documents and save PDF files as different images format including JPEG, PNG, TIFF, GIF, BMP, PCX, TGA etc.

Image

With PDF to Images tool, you can convert multiple PDF documents at once; you can select any pages to convert ; you can set options for your images format like output type, output colour and resolution...

Re: Quality PDF>Image

Posted: 2010-03-25T19:27:34-07:00
by fmw42
Rebel wrote:Wow thanks alot.

The script is really powerfull :O

nice build i need to say!

Do you also know about how to count the PDF pages. (i need it for echoing the images afterwords ;))
or do i need to go to someone ho knowes ghostscript?

Thanks anyway for the quality issue
convert rose: rose: rose: rose.pdf

echo `convert rose.pdf -format "%n" info:` | cut -d\ -f1
3

Note there seems to be a problem with just using:
convert rose.pdf -format "%n" info:
3
3
3

I will report it.

Re: Quality PDF>Image

Posted: 2010-07-12T11:45:33-07:00
by Mazin
Sorry if I'm bumping this from too long ago.

I'd like to point out that counting PDF pages with ImageMagick can be more intensive than you think. Even if you use identify instead of convert, ghostscript will still crunch through the entire PDF. If it's a big PDF, you might just find your CPU maxed and memory consumed until you're out of memory (at least on my 6.5.7-8).