java生成pdf2html
String cmds_ = "/usr/bin/pdf2htmlEX --no-drm 1 --split-pages 1 "
+ "--embed-css 1 --embed-javascript 0 --embed-image 0 --embed-font 1 "
+ "--fit-width 700 --bg-format jpg --auto-hint 1 --svg-node-count-limit 1 "
+ "--embed-external-font 0 --dest-dir /home/xueqy/testPdf/1 --page-filename 1-%d.page /home/xueqy/testPdf/1.pdf";
String[] cmds = { "/bin/sh", "-c", cmds_ };
Process pro = Runtime.getRuntime().exec(cmds);
pro.waitFor();
File file=new File("/home/xueqy/testPdf/1");
File [] files = file.listFiles();
for (int i =0; i < files.length; i++)
{
File file1 = files[i];
String fileName= file1.getName(); //根据后缀判断
if (fileName.endsWith("jpg")) {
Thumbnails.of(file1)
.scale(0.5f).outputQuality(0.3f)
.toFile("/home/xueqy/testPdf/1/"+fileName);
System.out.println(fileName);
}
else if(fileName.endsWith("png")||fileName.endsWith("js")){
System.out.println(fileName);
file1.delete();
}
}