Question : Extract / Create thumbnails (1st page) for office documents using PHP on Windows or Linux/Mac server

I was wondering if there is a way to extract or create thumbnails for office documents (i.e. Word, Excel and PowerPoint) using PHP so that I can display thumbnails for the 1st page of those documents in my web application.  Kind of like the Mac OS X does in the finder.

There is a pretty easy way to do that for PDF file using ImageMagick like:

   1. <?php
   2. //the path to the PDF file
   3. $strPDF = "my_pdf.pdf";
   4.
   5. exec("convert \"{$strPDF}[0]\" -colorspace RGB -geometry 1024 \"output.png\"");
   6. ?>

but I am unaware of a way to do the same for Office documents.  Was wondering if anyone new a way to do that using some other tools.  My servers are running PHP and MySQL on LINUX and Mac OS X servers with Ghostscript and ImageMagick installed.

Answer : Extract / Create thumbnails (1st page) for office documents using PHP on Windows or Linux/Mac server

Just a few documents, you could 'print' each to a pdf, then use your routine to make the thumbnail. Linux/Mac has 'make a pdf' but I don't know about PHP. I use 'CutePDFmaker' on the PC, which uses ghostscript and a 'pdf' printer to convert anything to pdf.
Random Solutions  
 
programming4us programming4us