Search in sources :

Example 1 with DocumentEntry

use of org.apache.pdfbox.debugger.ui.DocumentEntry in project pdfbox by apache.

the class PDFDebugger method initTree.

public void initTree() {
    TreeStatus treeStatus = new TreeStatus(document.getDocument().getTrailer());
    statusPane.updateTreeStatus(treeStatus);
    if (isPageMode) {
        File file = new File(currentFilePath);
        DocumentEntry documentEntry = new DocumentEntry(document, file.getName());
        ZoomMenu.getInstance().resetZoom();
        RotationMenu.getInstance().setRotationSelection(RotationMenu.ROTATE_0_DEGREES);
        tree.setModel(new PDFTreeModel(documentEntry));
        // Root/Pages/Kids/[0] is not always the first page, so use the first row instead:
        tree.setSelectionPath(tree.getPathForRow(1));
    } else {
        tree.setModel(new PDFTreeModel(document));
        tree.setSelectionPath(treeStatus.getPathForString("Root"));
    }
}
Also used : TreeStatus(org.apache.pdfbox.debugger.treestatus.TreeStatus) DocumentEntry(org.apache.pdfbox.debugger.ui.DocumentEntry) PDFTreeModel(org.apache.pdfbox.debugger.ui.PDFTreeModel) File(java.io.File)

Aggregations

File (java.io.File)1 TreeStatus (org.apache.pdfbox.debugger.treestatus.TreeStatus)1 DocumentEntry (org.apache.pdfbox.debugger.ui.DocumentEntry)1 PDFTreeModel (org.apache.pdfbox.debugger.ui.PDFTreeModel)1