简体   繁体   中英

Create a Word (.doc) file, convert it to PDF and HTML w/o opening Open Office port

I have a project which requires creating a Word (.doc) file with certain formatting and certain data fetched from my database. I want to output that file to user which he would edit and the upload the file back it back to the server. After which I want to perform the following conversion on the uploaded file.

  • .doc to .pdf (Intended to be downloaded and viewed on web)
  • .doc to .html (Intended for free text search on web)

I want to achieve this without opening the Open Office port. The earlier version was doing this but the port opened had tendency of crashing when the users are more. So I want to avoid doing that. The Open Office and the OS both were re-installed on other machines and tried in different ways but the OO port crashed every time the users increased.

Is there any other way to achieve this conversion? Continuing with this is not possible due to the crashing.

This is the host machine:

  • Tomcat server on Linux (RedHat 64 bit)
  • The application is developed in Java (JSP and Servlets)
  • The backend is Oracle

All users have:

  • A Linux machine, mostly 32bit Fedora or Suse

Any help is appreciated.

You could use http://poi.apache.org/ for handling the actual .doc files. For PDF, there are a number of PDF libraries available as well. The catch is that many are not free, but here is a list of open source PDF libraries: http://java-source.net/open-source/pdf-libraries

Here is a discussion on Word to HTML. Convert Word doc to HTML programmatically in Java

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM