Usage Scenarios: Non-PDF documents converted to PDF documents, using the new browser features or using the JS analog Document preview featureI. Non-PDF conversion PDF Document Technical Solution 1, Openoffic+jodconverter (with dependencies) OPENOFFIC3 only supports Microsoft Word 97/2000/XP,OPENOFFIC4 Requires GLIBC2 version 2.11, upgrade GLIBC2 may cause system crashes, 2, LibreOffice + unoconv (Python script) libreoffice3 only support Microsoft Word 97/2000/XP Libreoffice4 supports Microsoft Word 2003 and above conversions, but the effect of conversion is not very good
3, through a simple comparison, the efficiency of programme one is higher than the program II
II. implementation of the scheme 1, install openoffic (http://www.openoffice.org/download/index.html) decompression tar.gz package, switch to RPMs directory, with RPM-IVH--prefix installation directory *. RPM can be;
Start openofficsoffice-headless-accept= "SOCKET,HOST=127.0.0.1,PORT=8100;URP;"-nofirststartwizard
Rails leverages EncapsulationJodconverter plug-in for file conversion install plugin Rubyscript/plugin Install Git://github.com/amardaxini/convert_office.gitYou can passConvertoffice::convertofficeformat.new.convert (src_file,dest_file) for file conversion;
2.installationLibreoffice4 (http://download.documentfoundation.org/libreoffice/stable/) Unpack tar.gz package, execute install file, install RPMs directory Install directory start LibreOffice service soffice-headless-accept= "SOCKET,HOST=127.0.0.1,PORT=8100;URP;"-nofirststartwizard
DownloadUnoconv (https://github.com/dagwieers/unoconv/downloads) Copy Unoconv script to the project directory, execute script to convert file to Python unoconv-f pdf target file
Rails Document Online Preview scheme