public class ImageConverter extends Object implements DocConverter
| Constructor and Description |
|---|
ImageConverter(OutputStream output)
创建PDF转换OFD转换器
|
ImageConverter(Path ofdPath)
创建PDF转换OFD转换器
|
| Modifier and Type | Method and Description |
|---|---|
void |
append(Path filepath,
double width,
double height)
追加图片到新一页
|
void |
close() |
void |
convert(Path filepath,
int... indexes)
新建OFD页面并放入图片
|
void |
setPageSize(PageLayout pageLayout)
设置页面尺寸
|
void |
setPPM(double ppm)
设置图片质量
|
public ImageConverter(Path ofdPath) throws IOException
ofdPath - 转换后的OFD文件路径IOException - 文件解析异常public ImageConverter(OutputStream output) throws IOException
output - 转换后的OFD流IOException - 文件解析异常public void convert(Path filepath, int... indexes) throws GeneralConvertException
convert in interface DocConverterfilepath - 待转换文件路径indexes - 忽略GeneralConvertException - 转换异常public void append(Path filepath, double width, double height)
filepath - 图片文件width - 图片在页面中宽度height - 图片在页面中高度public void setPPM(double ppm)
ppm - 像素每毫米public void setPageSize(PageLayout pageLayout)
pageLayout - 页面尺寸public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2026. All rights reserved.