int pagenumber, RecursivePdfObjectIterator pageanalyzer, PdfReader pdfreader) {
super(page);
this.pagenumber = pagenumber;
DefaultMutableTreeNode info;
PdfArray arr = (PdfArray) page.get(PdfName.MEDIABOX);
float curwidth = 0;
float curheight = 0;
if (arr != null) {
ArrayList arl = arr.getArrayList();
curwidth = Float.parseFloat(arl.get(2).toString());
curheight = Float.parseFloat(arl.get(3).toString());
info = new ObjectTreeNode(PdfName.MEDIABOX + " " + curwidth
+ "*" + curheight);
this.add(info);
}
PdfArray arrcrop = (PdfArray) page.get(PdfName.CROPBOX);
if (arrcrop != null) {
ArrayList arl = arrcrop.getArrayList();
curwidth = Float.parseFloat(arl.get(2).toString());
curheight = Float.parseFloat(arl.get(3).toString());
info = new ObjectTreeNode(PdfName.CROPBOX + " " + curwidth
+ "*" + curheight);
this.add(info);
}
PdfNumber rotation = (PdfNumber) PdfReader.getPdfObject(page
.get(PdfName.ROTATE));
if (rotation == null) {
System.out.println("Rotation missing");
rotation = new PdfNumber(0);
} else {
info = new ObjectTreeNode(PdfName.ROTATE + " " + rotation);
this.add(info);
}
Rectangle rect = new Rectangle(curwidth, curheight);
if ((rotation.floatValue() == 90) || (rotation.floatValue() == 270)) {
rect = rect.rotate();
}
width = rect.width();
height = rect.height();
PdfArray dict = (PdfArray) PdfReader.getPdfObject(page.get(PdfName.ANNOTS));
if (dict != null) {
this.add(new ObjectTreeNode(PdfName.ANNOTS + " " + dict.length()));
ObjectTreeNode annots_node = new ObjectTreeNode(PdfName.ANNOTS + " " + dict.type());
this.add(annots_node);
pageanalyzer.iterateObjects(dict, pdfreader, annots_node);
}
PdfObject reso = PdfReader.getPdfObject(page.get(PdfName.RESOURCES));