Creating preview screenshots of files

Hi Everyone,

Has this been done before? I have tried searching several forums and se’s but got nothing. I have a client who has customers upload files of multiple types. .txt, .pdf, .doc, .rtf, .ppt, .docx. Is there a way to automatically create a preview of the file when it is uploaded? I know I can code the .txt (first x number of characters) and .pdf (thumbnail the first x pages) previews but have not found anything to create it for .rtf, .doc, .ppt, or .docx. Let me know your thoughts.

Best Regards,
Nick

Office 2007 documents (.docx, .***x), some contain thumbnails in an emf format which is a vector format so any size is possible. It is easy to get these thumbnail files because the document in question is a ZIP file. The thumbnail appears in the “docProps” folder at the root. However, a user may opt not to have these thumbnail files generated when saving.

I don’t think you’ll find a decent rendering engine for arbitrary PowerPoint and Word files programmed in PHP (but hey, anything’s possible). You can use COM to open up the file in Word/PowerPoint and take a screenshot on a Windows server.