public class TextConverter extends Object implements DocConverter
| 构造器和说明 |
|---|
TextConverter(OutputStream output)
创建PDF转换OFD转换器
|
TextConverter(Path ofdPath)
创建PDF转换OFD转换器
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
append(String txt)
追加文本,文本将新起一行
|
void |
close() |
void |
convert(Path filepath,
int... indexes)
向OFD页面中追加文本
|
void |
setFontSize(double fontSize)
设置字号
|
void |
setPageSize(PageLayout pageLayout)
设置页面尺寸
|
public TextConverter(Path ofdPath) throws IOException
ofdPath - 转换后的OFD文件路径IOException - 文件解析异常public TextConverter(OutputStream output) throws IOException
output - 转换后的OFD流,由调用者负责关闭。IOException - 文件解析异常public void convert(Path filepath, int... indexes) throws GeneralConvertException
convert 在接口中 DocConverterfilepath - 待转换文件路径indexes - 忽略GeneralConvertException - 转换异常public void append(String txt)
txt - 文本public void setPageSize(PageLayout pageLayout)
pageLayout - 页面尺寸public void setFontSize(double fontSize)
fontSize - 字号,单位:毫米(mm)public void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionCopyright © 2024. All rights reserved.