Page 1 of 1

How to convert Word document(.doc) or Excel(.xls) to jpg?

Posted: Tue Mar 31, 2009 4:01 am
by cafcaf1
Hello,

I am building up a website with php. What I want to do is, when I upload a word document or excel file to my website, I want to display the first page of this uploaded file as a preview (Server will get the file, take its first page as a picture, make it smaller and return.). However I couldn't find any tool or method to be able to display the first page preview. :banghead: Please help me with it.

Thanks.

Re: How to convert Word document(.doc) or Excel(.xls) to jpg?

Posted: Tue Mar 31, 2009 4:47 am
by greyhoundcode
Don't imagine you can do this using PHP alone.

Perhaps if you are using a Windows server or otherwise can connect to a Windows box you could install Word Viewer 2003 (or equivalent), and work some screengrabbing magic - I saw an excellent C# tutorial on doing just this (the screengrabbing that is) quite recently.

How you tie it all together though, well ... :?: