Results 1 to 2 of 2

Thread: How to create PDF file with high res photo's using PHP 4.0

  1. #1
    Join Date
    Jan 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy How to create PDF file with high res photo's using PHP 4.0

    Friends,

    I need your help. I run a website called KeenOwl Books (http://www.keenowl.com) that creates personalized life lesson childrens storybooks. Part of our personalization includes allowing customers to upload a photograph or image that is integrated into the printed storybook, along with other values for this specific customers personalization choices.

    We are using PHP 4.0 (as I am hosted on Yahoo!) and using a freeware PDF creation module (FPDF - see http://www.fpdf.org for more) that uses PHP to generate PDF files on the fly. However, the image or photo seems to be integrated into the dynamic PDF file at 72 DPI, even when the source images were at 100 DPI or higher. This results in pixelated images/photos in the resultant PDF file and of course, unhappy customers.

    Any idea on how one can integrate higher res images (e.g. 300 DPI) images into a dynamically generated PDF file AND preserve its resolution? Again, we are currently hosted on Yahoo using PHP 4.0. Need more info? let me know.

    Thanks all,

  2. #2
    Join Date
    Jun 2007
    Posts
    34
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    I've never done it. but ... recently started playing around with ImageMagick. It is command line type tool with ports on many OS, including two listed for PHP. Seems very powerful. It claims to read pdf with help of Ghostscript. If you can read the pdf, then you can convert it to other format like jpg which you might be able to implement easier for your application.

    I first learned of this ImageMagick reading a webpage where some map site was using png from inkscape and then processing thru imagemagick. Output was nice. So I tried with the windows binary and got nice result too, but file is larger then I wanted. Had to do additional processing in Gimp to reduce size. Image quality was terrific.

    For your application, if you can get these tools on your server then perhaps? Again, I've never tried.

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
  •