Achieve WORD documents, PDF documents online preview: specific implementation process

How to publish almost any document (word, excel, ..) to the web using FlexPaper ?

 

      Before the Internet to find online word document preview function, preview the document type mailbox, most implementations use FlexPaper principle is to show that there is a problem that will only support FlexPaper swf file, always first of all the documents in the local convert pdf converted to swf uploaded to the server, which obviously does not meet the actual needs of users because it is too much trouble. . . Even the format conversion is to be done automatically on the server side.

 

      Making documents available in the browser can be difficult when they are saved in many different formats. There are a number of products available that offer this service although many of them do this by simply using open source products that are available for free for you to use.

      One such open source product that can be used as a conversion engine is OpenOffice. This article describes how to use OpenOffice together with FlexPaper to display any format supported by OpenOffice directly in the browser.    

    

 

  •    Use SUN Company (looks like now is the oracle of the, oracle and gave apache tissue) of Openoffice complete office (Word, Excel, Powerpoint) conversion to pdf documents

1, all the files in a directory format DOC converted into PDF files
the Java -jar lib / jodconverter-cli-2.2.0.jar -f pdf * .doc
the Java -jar JConverterCommand.jar -f pdf F: \ * .doc

2, convert the file to develop
the Java -jar lib / jodconverter-cli-2.2.0.jar document.doc document.pdf
the Java -jar JConverterCommand.jar c: \ aaa.doc c: \ aaa.pdf

Described as follows:

OpenOffice.org has a little-known feature is its ability to run as a service, and this ability has certain magical. For example, you can put openoffice.og into a conversion engine, you can convert the format of the file through a network interface or the command-line tool with this conversion engine, JODConverter can help you achieve this OpenOffice.org file conversion Features.

In order to OpenOffice.org as a conversion engine, you must as a service to its start, it is connected to a specific port monitor, you can use the following command to start the Linux platform openoffice.org:
soffice -headless -accept = "socket, port = 8100; urp;"
in the Windows platform, use the following command:
"C: \ Program Files \ OpenOffice.org 3 \ Program \ soffice" -accept = "socket, port = 8100; urp;"

JODConverter is based on java, you need to install version 1.4 or higher java runtime environment. Download the latest version of jodconverter-tomcat-xxxzip, extract to a directory, you can start jodconverter
SH jodconverter-Tomcat-2.2.2 / bin / startup.sh
opened in a browser HTTP: // localhost: 8080 / Converter , you I can see a simple Web interface, select the file you want to convert and to determine the format, click on the button to convert. The file may be converted by the line of command, such as:
Java -jar jodconverter-2.1.1 / lib / jodconverter-2.2.2.jar loremipsum.odt loremipsum.pdf

 

 

Reproduced in: https: //my.oschina.net/usenrong/blog/197841

Guess you like

Origin blog.csdn.net/weixin_34015566/article/details/92028968