private List<APDMetaObject> getBookmarks(List<APDMetaObject> bookmarkList) throws IOException { if (bookmarkList == null) { bookmarkList = new ArrayList<APDMetaObject>(); } try { PDOutlineNode outline; try { outline = getDocument().getOutline(); } catch (ClassCastException ex) { outline = (PDOutlineNode)PDOutline.META.createFromCos(getDocument().getCatalog().cosGetOutline()); } getBookmarks(outline, bookmarkList); } catch (Exception e) { throw new IOException(e); } return bookmarkList; }