if (getValue("pdffile") == null) throw new InstantiationException("You need to choose a source PDF file");
if (getValue("destfile") == null) throw new InstantiationException("You need to choose a destination PDF file");
FileInputStream bmReader = new FileInputStream( (File) getValue("xmlfile") );
List<HashMap<String, Object>> bookmarks = SimpleBookmark.importFromXML( bmReader );
bmReader.close();
PdfReader reader = new PdfReader(((File)getValue("pdffile")).getAbsolutePath());
reader.consolidateNamedDestinations();
PdfStamper stamper = new PdfStamper(reader, new FileOutputStream((File)getValue("destfile")));
stamper.setOutlines(bookmarks);
stamper.setViewerPreferences(reader.getSimpleViewerPreferences() | PdfWriter.PageModeUseOutlines);
stamper.close();
}
catch(Exception e) {
e.printStackTrace();
JOptionPane.showMessageDialog(internalFrame,