有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

ICEPDF Java中书签的框架设置

我使用的是pdf查看器IcePDF,但当我运行应用程序时,书签不可用。我试过使用其他PDF,当目录仅在第一页时,它就可以工作。有人能帮我找到这个功能的设置吗

编辑:

下面是使用ICEPdf的代码

public static void main(String[] args) {
    final String filePath = "myFile.pdf";

    // build a component controller
    SwingController controller = new SwingController();

    PropertiesManager properties = new PropertiesManager(System.getProperties(),
            ResourceBundle.getBundle(PropertiesManager.DEFAULT_MESSAGE_BUNDLE));

    properties.setBoolean(PropertiesManager.PROPERTY_SHOW_UTILITY_PRINT, false); 

    SwingViewBuilder factory = new SwingViewBuilder(controller, properties);

    JPanel viewerComponentPanel = factory.buildViewerPanel();

    // add interactive mouse link annotation support via callback
    controller.getDocumentViewController().setAnnotationCallback(
            new MyAnnotationCallback(controller.getDocumentViewController()));

    //controller.getDocumentViewController().setDestinationTarget(controller.getDocument().getCatalog().getDestinations().);

    JFrame applicationFrame = new JFrame();
    applicationFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    applicationFrame.setTitle("Test ICEPdf");
    applicationFrame.getContentPane().add(viewerComponentPanel);

    // Now that the GUI is all in place, we can try openning a PDF
    controller.openDocument(filePath);

    // show the component
    applicationFrame.pack();
    applicationFrame.setVisible(true);
}

共 (0) 个答案