public void execute(AbstractParsedCommand parsedCommand) throws ConsoleException {
if((parsedCommand != null) && (parsedCommand instanceof SlideShowParsedCommand)){
SlideShowParsedCommand inputCommand = (SlideShowParsedCommand) parsedCommand;
PrefixParser prefixParser;
setPercentageOfWorkDone(0);
Transitions transitions = new Transitions();
transitions.setDefaultTransition(inputCommand.getDefaultTransition());
transitions.setTransitions(inputCommand.getTransitions());
transitions = parseXmlInput(inputCommand.getInputXmlFile(), transitions);
try{
prefixParser = new PrefixParser(inputCommand.getOutputFilesPrefix(), inputCommand.getInputFile().getFile().getName());
File tmpFile = FileUtility.generateTmpFile(inputCommand.getOutputFile());
pdfReader = new PdfReader(new RandomAccessFileOrArray(inputCommand.getInputFile().getFile().getAbsolutePath()),inputCommand.getInputFile().getPasswordBytes());
pdfReader.removeUnusedObjects();
pdfReader.consolidateNamedDestinations();
//version
LOG.debug("Creating a new document.");
Character pdfVersion = inputCommand.getOutputPdfVersion();
if(pdfVersion != null){
pdfStamper = new PdfStamper(pdfReader, new FileOutputStream(tmpFile), inputCommand.getOutputPdfVersion().charValue());
}else{
pdfStamper = new PdfStamper(pdfReader, new FileOutputStream(tmpFile), pdfReader.getPdfVersion());
}
//creator
HashMap meta = pdfReader.getInfo();
meta.put("Creator", ConsoleServicesFacade.CREATOR);
//compression
setCompressionSettingOnStamper(inputCommand, pdfStamper);
pdfStamper.setMoreInfo(meta);
//fullscreen
if(inputCommand.isFullScreen()){
pdfStamper.setViewerPreferences(PdfWriter.PageModeFullScreen);
}
//sets transitions
if(transitions.getDefaultTransition()==null){
setTransitionsWithoutDefault(transitions);
}else{
int totalPages = pdfReader.getNumberOfPages();
setTransitionsWithDefault(transitions, totalPages);
}
pdfStamper.close();
pdfReader.close();
File outFile = new File(inputCommand.getOutputFile() ,prefixParser.generateFileName());
FileUtility.renameTemporaryFile(tmpFile, outFile, inputCommand.isOverwrite());
LOG.debug("File "+outFile.getCanonicalPath()+" created.");
LOG.info("Slide show options set.");
}catch(Exception e){
throw new SlideShowException(e);
}finally{