关于openOffice对于word的转换及遇到的问题

 

一:需求详情:

  公司需要存储合同文件,用户上传word文档的合同,通过openOffice去把word转换为pdf、再把pdf转换为图片格式,并分别存储。因为openOffice的转换需要耗费挺大的内存,所以设计为task任务,凌晨自动转换。

  记录本次需求完成的时候遇到的问题。

 

二:过程

  1:本地环境编码(windows)

  第一步:因为是本地环境的编码而且是Windows环境,所以从安装openOffice开始,到启动服务并没有遇到难题。

  第二步:转换所需要的工具包;

 1 <dependency>  2     <groupId>commons-cli</groupId>  3     <artifactId>commons-cli</artifactId>  4     <version>1.2</version>  5 </dependency>  6   7 <dependency>  8     <groupId>commons-io</groupId>  9     <artifactId>commons-io</artifactId> 10     <version>1.4</version> 11 </dependency> 12  13 <dependency> 14     <groupId>org.openoffice</groupId> 15     <artifactId>juh</artifactId> 16     <version>3.0.1</version> 17 </dependency> 18  19 <dependency> 20     <groupId>org.openoffice</groupId> 21     <artifactId>jurt</artifactId> 22     <version>3.0.1</version> 23 </dependency> 24  25 <dependency> 26     <groupId>org.openoffice</groupId> 27     <artifactId>ridl</artifactId> 28     <version>3.0.1</version> 29 </dependency> 30  31 <dependency> 32     <groupId>org.slf4j</groupId> 33     <artifactId>slf4j-api</artifactId> 34 </dependency> 35  36 <dependency> 37     <groupId>org.slf4j</groupId> 38     <artifactId>slf4j-jdk14</artifactId> 39     <scope>test</scope> 40 </dependency> 41  42 <dependency> 43     <groupId>org.openoffice</groupId> 44     <artifactId>unoil</artifactId> 45     <version>3.0.1</version> 46 </dependency> 47  48 <dependency> 49     <groupId>com.thoughtworks.xstream</groupId> 50     <artifactId>xstream</artifactId> 51     <version>1.3.1</version> 52 </dependency> 53  54 <dependency> 55     <groupId>org.apache.pdfbox</groupId> 56     <artifactId>fontbox</artifactId> 57     <version>2.0.8</version> 58 </dependency> 59  60 <dependency> 61     <groupId>org.apache.pdfbox</groupId> 62     <artifactId>pdfbox</artifactId> 63     <version>2.0.8</version> 64 </dependency>

                    
                
50000+
5万行代码练就真实本领
17年
创办于2008年老牌培训机构
1000+
合作企业
98%
就业率

联系我们

电话咨询

0532-85025005

扫码添加微信