I’m currently working on a website that will enable users to upload certain types of files.
Upon the file(s) being uploaded, I need to generate a preview of the file(s) content, in image format.
For example, if somebody was to upload a .doc file containing a letter of some sort (e.g. Absence Letter), then a preview image of the letter needs to be generated.
Some of the files I need to upload and generate a preview of include, but are not limited to: .doc(x), .jpg, .ppt(x), .xls(x), .html, .psd.
Can this be done with PHP?
If not, where would be the best place to start in order to develop this functionality as an extension to PHP?, and what languages could this be done in?
Just my two cents here. This is something no programming language can do inherently. Languages are designed to do something special and do that very well. There might be extensions or additional libraries for certain “common” problems, like PEAR. Mainly because you are dealing here with some proprietary document types (.doc,.ppt,.xls,.psd). First you will need an application able to interpret the source document and by that I mean this application needs a API. Microsoft has VBA for this. Second, this API or another application (it also requires an API) must be able to generate an image of the document, not like a screen shot but a PDF print out. Then there is the big question if or how this APIs are accessible with PHP.
So, I am not saying it cannot be done but there is just no do-it-all language. You have to get and use multiple languages to get your result. PHP I think is still a good solution to tie everything together, though.