SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Ghostscript required or not for pdf to image conversion?

    Quick Question:
    Is Ghostscript required or not for pdf to image conversion(using ImageMagick & exec() method)?
    Do pdf to image conversion for multi-page pdf is supported by ImageMagick?

    Thanks.

  2. #2
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,362
    Mentioned
    80 Post(s)
    Tagged
    3 Thread(s)
    Yes ghostscript is required and yes IM will work on multipage pdfs.

    ImageMagick forum: http://www.imagemagick.org/discourse-server/

    Imagemagick examples: http://www.imagemagick.org/Usage/

    I have some examples on my site using php but not much to do with pdf files.

  3. #3
    SitePoint Wizard PHPycho's Avatar
    Join Date
    Dec 2005
    Posts
    1,201
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Image Magick Commands

    for Single page pdf conversion:
    PHP Code:
    exec('convert input.pdf output.jpg'); 
    for multi-page pdf conversion:
    PHP Code:
    exec('convert input.pdf output-%d.jpg'); 
    But i am facing the quality issues in jpg files.

    How to maintain the quality of jpf files? any commands for it?

    Thanks

  4. #4
    SitePoint Mentor silver trophy
    Rubble's Avatar
    Join Date
    Dec 2005
    Location
    Cambridge, England
    Posts
    2,362
    Mentioned
    80 Post(s)
    Tagged
    3 Thread(s)
    Try:

    PHP Code:
    exec('convert -density 400 input.pdf -quality 100 output.jpg'); 


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •