public class TextExporter extends Object implements OFDExporter
注意:部分OFD文档由于采用字形索引来定位文字、有个OFD整个页面均为路径数据图元而不是文字图元、有的OFD页面整个都为图片等诸多原因。 因此该导出器可能文档文本,另外由于文本布局等各种因素,导出文档也难以保证文本顺序与预期一致。
| 构造器和说明 |
|---|
TextExporter(InputStream ofdInput,
OutputStream txtOutput)
构造图片转换器
|
TextExporter(Path ofdFilePath,
Path txtPath)
构造图片转换器
|
public TextExporter(Path ofdFilePath, Path txtPath) throws IOException
ofdFilePath - 待转换OFD文件txtPath - 生成图片存放目录IOException - 文件解析异常public TextExporter(InputStream ofdInput, OutputStream txtOutput) throws IOException
ofdInput - 待转换OFD文件流,该文件流由调用者负责关闭txtOutput - 文本输出流IOException - 文件解析异常public void export(int... indexes)
throws GeneralConvertException
export 在接口中 OFDExporterindexes - 页码序列,如果为空表示全部页码(注意:页码从0起)GeneralConvertException - 转换异常public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2024. All rights reserved.