Commit 09a7efde authored by 夏彬's avatar 夏彬

修改java处理ppt服务

parent d5bb88e0
...@@ -95,6 +95,9 @@ public class PptToImages { ...@@ -95,6 +95,9 @@ public class PptToImages {
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
System.out.println(e); System.out.println(e);
} catch (IOException e) { } catch (IOException e) {
System.out.println(e);
} catch (Exception e) {
System.out.println(e);
} }
return false; return false;
} }
...@@ -131,17 +134,17 @@ public class PptToImages { ...@@ -131,17 +134,17 @@ public class PptToImages {
hslfSlide.draw(graphics); hslfSlide.draw(graphics);
// 这里设置图片的存放路径和图片的格式(jpeg,png,bmp等等),注意生成文件路径 // 这里设置图片的存放路径和图片的格式(jpeg,png,bmp等等),注意生成文件路径
FileOutputStream out = new FileOutputStream(outPut + "image_" + (i + 1) + ".jpg"); FileOutputStream out = new FileOutputStream(outPut + "/image_" + (i + 1) + ".jpg");
javax.imageio.ImageIO.write(img, "jpg", out); javax.imageio.ImageIO.write(img, "jpg", out);
out.close(); out.close();
break;
} }
return true; return true;
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
System.out.println(e); System.out.println(e);
// System.out.println("Can't find the image!");
} catch (IOException e) { } catch (IOException e) {
System.out.println(e);
} catch (Exception e) {
System.out.println(e);
} }
return false; return false;
} }
......
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