简体   繁体   English

创建一个Word(.doc)文件,无需打开Open Office端口即可将其转换为PDF和HTML

[英]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. 我有一个项目,该项目需要创建具有某些格式和从数据库中获取的某些数据的Word(.doc)文件。 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到.pdf (打算在网络上下载和查看)
  • .doc to .html (Intended for free text search on web) .doc到.html (旨在在网上进行免费文本搜索)

I want to achieve this without opening the Open Office port. 我想在不打开Open Office端口的情况下实现此目的。 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. Open Office和OS都重新安装在其他计算机上,并以不同的方式尝试,但是每次用户增加时OO端口都崩溃。

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) Linux上的Tomcat服务器(RedHat 64位)
  • The application is developed in Java (JSP and Servlets) 该应用程序是用Java开发的(JSP和Servlets)
  • The backend is Oracle 后端是Oracle

All users have: 所有用户都具有:

  • A Linux machine, mostly 32bit Fedora or Suse Linux机器,主要是32位Fedora或Suse

Any help is appreciated. 任何帮助表示赞赏。

You could use http://poi.apache.org/ for handling the actual .doc files. 您可以使用http://poi.apache.org/处理实际的.doc文件。 For PDF, there are a number of PDF libraries available as well. 对于PDF,还有许多可用的PDF库。 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 问题是很多不是免费的,但是这里列出了开源PDF库: http : //java-source.net/open-source/pdf-libraries

Here is a discussion on Word to HTML. 这是有关Word to HTML的讨论。 Convert Word doc to HTML programmatically in Java 在Java中以编程方式将Word doc转换为HTML

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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