Commit 26e48fd8 authored by “yiyousong”'s avatar “yiyousong”
parents 7f16c788 f615e5dd
package com.mortals.xhx.common.utils;
//import com.aspose.words.Document;
//import com.aspose.words.ImageSaveOptions;
//import com.aspose.words.SaveFormat;
import com.aspose.words.Document;
import com.aspose.words.ImageSaveOptions;
import com.aspose.words.SaveFormat;
......@@ -13,7 +10,6 @@ import freemarker.template.Template;
import lombok.extern.apachecommons.CommonsLog;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.rendering.PDFRenderer;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import javax.imageio.stream.ImageInputStream;
......@@ -71,28 +67,7 @@ public class WordUtil {
return flag;
}
/**
* 将图片转换成二进制字符串
*
* @param imgFilePath : 图片路径
* @return
*/
public String getImageStr(String imgFilePath) {
InputStream in = null;
byte[] data = null;
try {
in = new FileInputStream(imgFilePath);
data = new byte[in.available()];
in.read(data);
in.close();
} catch (Exception e) {
e.printStackTrace();
}
BASE64Encoder encoder = new BASE64Encoder();
return encoder.encode(data);
}
public static String convertWordToJPEG(String inputFile, String jpegPath) {
try {
......
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