Class TextConverter
java.lang.Object
org.ofdrw.converter.ofdconverter.TextConverter
- All Implemented Interfaces:
Closeable, AutoCloseable, DocConverter
文本转换为OFD
- Since:
- 2023-3-14 23:09:08
- Author:
- 权观宇
-
Constructor Summary
ConstructorsConstructorDescriptionTextConverter(OutputStream output) 创建PDF转换OFD转换器TextConverter(Path ofdPath) 创建PDF转换OFD转换器 -
Method Summary
Modifier and TypeMethodDescriptionvoid追加文本,文本将新起一行voidclose()void向OFD页面中追加文本voidsetFontSize(double fontSize) 设置字号voidsetPageSize(PageLayout pageLayout) 设置页面尺寸
-
Constructor Details
-
TextConverter
创建PDF转换OFD转换器- Parameters:
ofdPath- 转换后的OFD文件路径- Throws:
IOException- 文件解析异常
-
TextConverter
创建PDF转换OFD转换器- Parameters:
output- 转换后的OFD流,由调用者负责关闭。- Throws:
IOException- 文件解析异常
-
-
Method Details
-
convert
向OFD页面中追加文本- Specified by:
convertin interfaceDocConverter- Parameters:
filepath- 待转换文件路径indexes- 忽略- Throws:
GeneralConvertException- 转换异常
-
append
-
setPageSize
-
setFontSize
public void setFontSize(double fontSize) 设置字号- Parameters:
fontSize- 字号,单位:毫米(mm)
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-