@SuppressWarnings("unchecked")
List<PDPage> pages = (List<PDPage>) document.getDocumentCatalog().getAllPages();
for (PDPage p : pages) {
PDPageAdditionalActions aa = p.getActions();
if (aa != null) {
COSDictionary dict = aa.getCOSDictionary();
COSBase o = dict.getItem(COSName.O);
if (o != null && o instanceof COSObject) {
COSObject o2 = (COSObject) o;
if (o2.getObject() instanceof COSDictionary) {
COSDictionary o3 = (COSDictionary) o2.getObject();