Java converts word to PDF with OpenOfficeFirst, Software Installation and Jar Package DownloadThe official website is as follows (English):OpenOffice http://www.openoffice.org/Jodconverter http://sourceforge.net/projects/jodconverter/files/JODConverter/You can also Baidu to search, on the csdn above can also download to the required package.jodconverter:http://download.csdn.net/download/yali1990515/4443791A
Recently because of the project needs, the Word document to the PDF online preview, because there has been no contact with this piece, so it took nearly four days to figure out.
The main purpose of writing this article is to deepen your memory, and at the same time make it easier to use later.
(Recently used this feature, found that this article has a lot of problems, have been modified, sorry)
The tools needed are
Java uses openoffice to convert doc and docx into pdf instance code, openofficedocx
This article focuses on Java programming using openoffice to convert doc and docx into pdf implementation code, as detailed below.1. Required Software
OpenOffice, JodConverter2. Start the
The main function of Baidu Library is to upload the Word document, transcoding into PDF format and then show it. There are four ways to do this:method One: Use Apache Pio to read the doc file, and then convert the HTML file into a jsoup format HTML file, and finally use Itext to convert the HTML file into PDF. Method 2: Use Jdoctopdf to implement, this is a package good package, you can convert the doc to
"; // The source FILE, DOC or WPS can all be $ output_file = dirname (_ FILE __). "/11.20."; // name of the file to be converted to PDF $ doc_file =" file :///". $ doc_file; $ output_file = "file :///". $ output_file; $ document-> word2pdf ($ doc_file, $ output_file );
I found that the Code has always reported an error.
(! ) Fatal error: Uncaught exception 'com _ exception' with message'
(! ) Com_exception:
Finally, the original transfer path proble
1. Save the following code as documentconvert.py2. Copy the file to the $OPENOFFICE/program ($OPENOFFICE main directory)3. After entering the program directory, start the OpenOffice service and start the service command as follows:./soffice-headless-accept= "SOCKET,HOST=127.0.0.1,PORT=8100;URP;"-nofirststartwizard 4. Perform the following command for document con
service shutdown. If you think this is an impact on system performance, you can also start the OpenOffice service separately.Third, Program Code Package Com.sheke.wenku;import java.io.File;import java.io.FileNotFoundException;import java.io.IOException;import Com.artofsolving.jodconverter.DocumentConverter;import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;import com.artofsolving.jodconverter.openoffice.connection.SocketO
Document Conversion Performance TestTwo PDF conversion components are used in the financial systemOne is com.artofsolving, which is the first time the system references a component:
Another is the org.artofsolving, the second time the system refers to the upload component:
These two kinds of performance are different in the process of project development testing,First, OpenOffice is 4.1.2.Support recomm
Using openoffice to convert the office into a pdf file makes the component unusable. please help me. At the end of this post, nationzhou edited php nbsp in 2013-05-1816: 42: 24; converted the office into pdf format using openoffice nbsp; the following code is provided: function nbsp; makePropertyValue converts the o
Using openoffice to convert the office into a pdf file makes the component unusable. please help me. At the end of this post, nationzhou edited php nbsp in 2013-05-1816: 42: 24; converted the office into pdf format using openoffice nbsp; the following code is provided: function nbsp; makePro uses
The system environment is wamp + win7. After openoffice is installed, the start and activation permissions of openofficeservicemanneger are set to everyone. Then use the following code to convert doc into pdf {code ...} test Error: Fatalerror: Uncaughtexception #039; com _... the system environment is wamp + win7. After openoffice is installed, you have set the
Use OpenOffice to convert Office to PDF, the components can not be used, please heroes help.
This post was last edited by Nationzhou on 2013-05-18 16:42:24
PHP uses OpenOffice to turn office into PDF format questions to ask
The code is as follows:
function Makepropertyvalue ($name, $value, $OSM) {$oStruct = $osm->bri
OpenOffice Download Address: http://www.openoffice.org/
Jodconverter jar Pack Download: http://sourceforge.net/projects/jodconverter/files/JODConverter/
PS: When installing OpenOffice, the path as far as possible does not have the Chinese or the space and so on information, will cause the call error.
Package com.kingt;
Import Java.io.File;
Import java.io.FileNotFoundException;
Import java.io.IOException;
Php uses openoffice to convert office to pdf format. for example, find the code PHPcodefunctionword2pdf ($ doc_url, $ output_url) {InvoketheOpenOffice. orgservicemanager $ osmnewCOM ( q php uses openoffice to convert office to pdf format.
Find the code from the internet
PHP code
function word2pdf($doc_url, $
Php uses openoffice to convert office to pdf format. for example, find the code PHPcodefunctionword2pdf ($ doc_url, $ output_url) {InvoketheOpenOffice. orgservicemanager $ osmnewCOM ( quot; php uses openoffice to convert office to pdf format.
Find the code from the internet
PHP code
function word2pdf($doc_ur
Java calls openoffice to convert office documents to PDF. openofficepdf
Leading:
During the release process, we often use java to convert office documents to PDF files. Generally, Microsoft openoffice + jodconverter is used to convert documents.
Openoffice is available in bo
PHP uses OpenOffice to turn office into PDF format
Title find the code from the Internet
PHP Code
function Word2pdf ($doc _url, $output _url) {//invoke The OpenOffice.org Service Manager $OSM = new COM ("Com.sun.star.ServiceManager") or Die ("Sure, that OpenOffice.org is installed.\n"); Set the application to remain hidden to avoid flashing the document onscreen $args = Array ($this->makepr
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.