Provides various official and user-released code examples. For code reference, you are welcome to exchange and learn instructions from superior leaders. To achieve an online document display function, the class is Baidu document. Baidu and google have worked hard for several days and finally found the implementation solution. Now I will share the Code with you. If you have a better implementation solution, please kindly advise.
Demonstration machine sub-wood available
1. Implementation Method:
1.1 Use
LibreofficeConvert documents such as doc, xls, ppt, docx, xlsx, and pptx. Convert it to pdf,
1.2 use
SwftoolsConverts a PDF file to a swf file, that is, a flash playback file.
1.3 Use
FlexPaperTo display swf.
2. Implementation environment:
2.1 Ubuntu 12.04 64bit
2.2 Apaceh 2.2.x + php5.3.x + mysql
2.3 universal platform v0.1http: // www.thinkphp1.cn/code/838.html
2.4 Libreoffice 3.5.x or above http://zh-cn.libreoffice.org/
2.5 FlexPaper 2.2.4 http://flexpaper.org/
2.6 SwfTools http://www.swftools.org/download.html
2.7 jre 1.6 or above.
3. How to play the game:
3.1 install general purpose, and then install the document and Attach (Attachment ).
3.2 configuration document Converter
If a third-party converter is used, enter the correct command in the command line. Otherwise, the conversion fails.
3.3 configure Flexpaper
Enter the Flexpaper user name and password.
Enter the absolute path of the attachment storage folder (that is, the path for saving documents such as doc) in PDF storage Directory:
For example,/var/www/wwwroot/Uploads /...
Enter the path for saving the swf generated by the Working Directory. Generally, the PDF Storage Directory must be consistent.
3.4 add a document. If the uploaded document is in Pdf format. It can be displayed without conversion. If it is in another format, convert it to pdf. Please wait patiently during the conversion.
4. Display Effect
5. Conclusion
5.1 tested. Liberoffice 3.5.x is not suitable for file conversion of Microsoft Office. Text is often converted into garbled characters. We recommend that you use a later version of Liberoffice. It seems that there are more than 4.0. Or directly convert the document to PDF in office 20xx and then upload it. Better results.
5.2 demo address: http: // 120.24.73.164/index. php/Admin/Public/index
Guest@admin.com account
Password 1234
5.3 GitHub: https://github.com/zuweie/ebtAdmin
5.4 new projects are ready to be put on the horse, and the company's computers cannot be messed up at will. In the near future, no demonstration machine will be used. But the code is still shared.
5.5 there is really nothing in the general-purpose backend v0.1, and there is certainly no onethink rich content, amazing. After all, my personal energy is limited. This was the idea that ThinkSNS was recently used as a project and its background architecture was very good. At least ThinkSNS has field configuration. And module management, as well as data input and output pages, can be quickly generated through simple configuration. This is not found in onethink. You can download it to study its code. Looking at the surface of the backend is indeed a waste of shit, hahaha...
AD: truly free, domain name + VM + enterprise mailbox = 0 RMB