Read data from doc, xls files with PHP

这一生的挚爱 提交于 2019-12-10 20:34:42

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!