OFD ⽂件转换成PDF 格式,Java 语⾔实现
OFD ⽂件转换成PDF 格式,Java 语⾔实现
我个⼈的思路⼤致是这样的。⾸先在指定路径创建⼀个⽂件夹,然后每次要转换的时候都把OFD⽂件统⼀放到指定的⽂件夹内进⾏转换。这样写代码的时候只需要循环遍历⼀下就⾏。然后其他就是⼀些字符串的操作。
⼯具如下
代码如下<project xmlns ="/POM/4.0.0" xsi ="/2001/XMLSchema-instance " schemaLocation ="/POM/4.0.0 /xsd/maven-4.0.0.xsd "> <modelVersion >4.0.0</modelVersion > <groupId >OFDParser </groupId > <artifactId >OFDParser </artifactId > <version >0.0.1-SNAPSHOT </version > <build > <plugins > <plugin > <groupId >org.apache.maven.plugins </groupId > <artifactId >maven-compiler-plugin </artifactId > <configuration > <source >8</source > <target >8</target > </configuration > </plugin > </plugins > </build > <packaging >jar </packaging > <name >OFDParser </name > <url > </url > <properties >
<project.build.sourceEncoding >UTF-8</project.build.sourceEncoding > <itext.version >7.1.3</itext.version > </properties > <dependencies > <dependency > <groupId >org.ofdrw </groupId > <artifactId >ofdrw-full </artifactId > <version >1.8.6</version > </dependency > <dependency > <groupId >org.apache.pdfbox </groupId > <artifactId >pdfbox </artifactId > <version >2.0.4</version > </dependency > </dependencies ></project >
1
2
3
4
5
6
7
8
9
10
11
12
properties是什么文件clothes发音13
14
15
16
17
18
19
html文件怎么用记事本打开20
21
两个线程访问同一个全局变量22
23
24
php网站首页方框代码25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
编程语言的鄙视链
41
42
43
44
45
46
import GeneralConvertException ;import ImageMaker ;import OFDReader ;import ImageIO ;import BufferedImage ;import *;import Files ;import Path ;import Paths ;import static ConvertHelper .ofd2pdf ;//PDF import PDDocument ;import PDFTextStripper ;/** * ofd ⽂件⼯具类 */public class OfdUtil { /** * 获得⽂件名后缀 * @return */ public static String getLastFileName (String file ){ String lastName = file .substring (file .length ()-4,file .length ()); //只扫描四位 return lastName ; } public static String replaceOdfToPdf (String fileName ){ //修改⽂件后缀1234567891011121314151617181920212223242526272829
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论