问题
I wonder is it possible to read data from doc and xls files and put the readed content into image files(create page samples of the document). For example I have documents that I want my customers to buy. So I need automatically to create little images like samples of mine documents.
Your help would be appreciated.
回答1:
For reading from xls files I can really recommend PHPExcel whic is a really simple, but powerful tool:) As for doc I unfortunatly got no good recommandation for you. But I'm sure there's something good out there.
Edit: Found a quick little solution to reading doc-files with one line of code using terminal commands, might not cover all your needs, but thought it was worth a mention. Note that this is only for doc, not docx. Read doc from PHP
回答2:
Although this would be very cool and very handy, unfortunately not. There might be a way to do it with the Google Docs API, but I doubt it :-(
James
回答3:
Providing your are on Linux you can use Antiword to get just the text of a Word 2000 doc. To get the text content of a Word 2007 document you need to unzip it and read the XML contained with in. Like this http://www.webcheatsheet.com/PHP/reading_the_clean_text_from_docx_odt.php
To get a screenshot of the actual word doc with all its formatting however would probably require running a version of Word on the server and screenshotting it like Litmus does with browsers.
回答4:
from the below link download
excelreader.zip
this is the best for reading..
http://forums.hscripts.com/viewtopic.php?f=11&t=5200
来源:https://stackoverflow.com/questions/4645180/read-data-from-doc-xls-files-with-php