views:

56

answers:

1

Hi guys. Long time viewer, first time question asker.

I'm trying to have my personal website parse through my mail box for attachments from a certain subscription list, and then be able to view the PDF attachments as images, preferably jpg.

With the help of this: http://www.linuxscope.net/articles/mailAttachmentsPHP.html I'm currently using imap_base64() to decode the MIME data and create the PDF. However, I hate using PDF readers in general and I thought it would be a lot more streamlined if I could just view it as an image instead. I've heard for convert with ImageMagick, but would I need to actually write the PDF to a directory before using this, or can I convert somehow directly from the MIME data in the email?

Thanks in advance!

A: 

Install and use the Imagick PHP module: http://www.php.net/manual/en/book.imagick.php

bogdanvursu
I mentioned that I've seen convert with ImageMagick, and it's already installed on my shared webhost. However, if it's possible, how do I use it to convert the MIME data in an email attachment to JPG? It seems like I have to write the data to PDF somewhere first, which I would like to avoid. I would like to do this on the fly, as I have been with PDF downloads.
MisterCheese
Well if this is UNIX /proc/self/fd/3 might be usable as a filename, but then again PHP doesn't expose that directly so guess what, you get to write a C module to translate the interface.
Joshua