import org.apache.poi.util.JvmBugs;\r
\r
/**\r
- * An utulity to convert slides of a .pptx slide show to a PNG image\r
+ * An utility to convert slides of a .pptx slide show to a PNG image\r
*\r
* @author Yegor Kozlov\r
*/\r
" -slide <integer> 1-based index of a slide to render\n" +\r
" -format <type> png,gif,jpg (,null for testing)" +\r
" -outdir <dir> output directory, defaults to origin of the ppt/pptx file" +\r
- " -quite do not write to console (for normal processing)";\r
+ " -quiet do not write to console (for normal processing)";\r
\r
System.out.println(msg);\r
// no System.exit here, as we also run in junit tests!\r
File file = null;\r
String format = "png";\r
File outdir = null;\r
- boolean quite = false;\r
+ boolean quiet = false;\r
\r
for (int i = 0; i < args.length; i++) {\r
if (args[i].startsWith("-")) {\r
format = args[++i];\r
} else if ("-outdir".equals(args[i])) {\r
outdir = new File(args[++i]);\r
- } else if ("-quite".equals(args[i])) {\r
- quite = true;\r
+ } else if ("-quiet".equals(args[i])) {\r
+ quiet = true;\r
}\r
} else {\r
file = new File(args[i]);\r
return;\r
}\r
\r
- if (!quite) {\r
+ if (!quiet) {\r
System.out.println("Processing " + file);\r
}\r
SlideShow<?,?> ss = SlideShowFactory.create(file, null, true);\r
for(Slide<?,?> slide : slides) {\r
if (slidenum == -1 || slideNo == slidenum) {\r
String title = slide.getTitle();\r
- if (!quite) {\r
+ if (!quiet) {\r
System.out.println("Rendering slide " + slideNo + (title == null ? "" : ": " + title));\r
}\r
\r
slideNo++;\r
}\r
\r
- if (!quite) {\r
+ if (!quiet) {\r
System.out.println("Done");\r
}\r
+ \r
+ ss.close();\r
}\r
\r
@SuppressWarnings("unchecked")\r