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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cafcaf1
Forum Newbie
Posts: 1
Joined: Tue Mar 31, 2009 3:51 am

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

Post 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.
User avatar
greyhoundcode
Forum Regular
Posts: 613
Joined: Mon Feb 11, 2008 4:22 am

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

Post 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 ... :?:
Post Reply