Commit 254100cf authored by 廖旭伟's avatar 廖旭伟

优化word转换工具,最多只转换3页

parent 180f8d8c
......@@ -92,6 +92,9 @@ public class WordUtil {
options.setUseAntiAliasing(true);
options.setUseHighQualityRendering(true);
int pageCount = doc.getPageCount();
if(pageCount>2){
pageCount=2;
}
List<BufferedImage> imageList = new ArrayList<BufferedImage>();
for (int i = 0; i < pageCount; i++) {
OutputStream output = new ByteArrayOutputStream();
......@@ -234,9 +237,9 @@ public class WordUtil {
}
public static void main(String[] args) {
String docPath = "E:\\pic\\doc\\2.docx";
String docPath = "D:\\home\\mortals\\app\\施工合同(示范文本).doc";
String jpgPath = "E:\\pic\\doc\\2.jpg";
String jpgPath = "D:\\home\\mortals\\app\\aaa.jpg";
WordUtil.convertWordToJPEG(docPath, jpgPath);
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment