Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The office document of linux platform is transferred to pdf instance (programmer's dish)

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Materials required:

1. Openoffice3.4 (I am a 32-bit centos, and I can download the specified openoffice software package according to my own system)

Download address: http://sourceforge.net/projects/openofficeorg.mirror/files/stable/3.4.1/Apache_OpenOffice_incubating_3.4.1_Linux_x86_install-rpm_en-US.tar.gz/download

2 、 jodconverter.2.2.2

Download address: http://sourceforge.net/projects/jodconverter/files/latest/download?source=files

3. 32-bit centos5.5 (a lot of Internet searches)

4 、 jdk1.7

The idea is simply to install openoffice3.4 and convert the document with jodconverter.2.2.2.

Detailed steps:

1. Decompress the downloaded openoffice package and enter the directory of the package. Only use the following command.

Package name of tar-zxvf openoffice

2. After decompressing, a zh-CN (or something similar, depending on the language) will be generated. After entering the directory, there will be a rpms and enter the rpms folder. Type the following command to install openoffice (if you are prompted for any dependencies, you need to install them one by one. Some systems: rpm-ivh * .rpm, will not be installed automatically)

Rpm-ivh * .rpm

3. After installation, you should start the openoffice service. Enter the following command, and openoffice is installed by default in the / opt file. (if you start the service, you will encounter a series of errors. You can find the search engine.)

/ opt/openoffice.org3/program/soffice-headless-accept= "socket,host=127.0.0.1,port=8100;urp;"-nofirststartwizard &

4. Determine whether the openoffice service is enabled successfully.

Ps aux | grep soffice to view the process

5. After enabling the openoffice service successfully, use jodconverter.2.2.2 to convert. You can use the following command (it is best to use the root user, otherwise you will encounter a lot of permission problems)

Decompression path of jodconverter: / usr/local/wenku/jodconverter-2.2.2/lib/jodconverter-cli-2.2.2.jar

File to be converted: / tmp/1.doc

Converted file: / tmp/1.pdf

Java-jar / usr/local/wenku/jodconverter-2.2.2/lib/jodconverter-cli-2.2.2.jar / tmp/1.doc / tmp/1.pdf

If successful, there will be an extra pdf file under the / tmp folder.

Open pdf if there is garbled code, please see (solve the problem of Chinese garbled code from openoffice word file to PDF under linux)

The above linux platform office document to pdf example (programmer's dish) is the editor to share with you all the content, I hope to give you a reference, but also hope that you support more.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report