byte[] password = null;
if((item.getPassword()) != null && (item.getPassword()).length()>0){
password = item.getPassword().getBytes();
}
PdfReader pdfReader = new PdfReader(new RandomAccessFileOrArray(item.getInputFile().getAbsolutePath()),password);
pdfReader.consolidateNamedDestinations();
List bookmarks = SimpleBookmark.getBookmark(pdfReader);
ByteArrayOutputStream out = new ByteArrayOutputStream();
SimpleBookmark.exportToXML(bookmarks, out, "UTF-8", false);
ByteArrayInputStream input = new ByteArrayInputStream(out.toByteArray());
int maxDepth = PdfUtility.getMaxBookmarksDepth(input);