【问题标题】:WARNING: PDF write support was not found on the class path警告:在类路径上找不到 PDF 写入支持
【发布时间】:2017-11-11 08:09:03
【问题描述】:

请朋友们,我在查看 pdf 文件时遇到这个困难,它给出了下面的错误

org.icepdf.core.pobjects.Document 警告:在类路径上找不到 PDF 写入支持 2017 年 6 月 9 日上午 8:32:10 org.icepdf.core.pobjects.Catalog

下面是我的代码

import javax.swing.JFrame;
import javax.swing.JPanel;
import org.icepdf.ri.common.ComponentKeyBinding;
import org.icepdf.ri.common.SwingController;
import org.icepdf.ri.common.SwingViewBuilder;

/**
 *
 * @author LabaPc
 */
public class viewPDF {



    public viewPDF() {

    }

    public void displayPDF(JPanel viewerComponentPanel, String filePath) {
        // build a controller
        SwingController controller = new SwingController();

// Build a SwingViewFactory configured with the controller
        SwingViewBuilder factory = new SwingViewBuilder(controller);

// Use the factory to build a JPanel that is pre-configured
//with a complete, active Viewer UI.
        viewerComponentPanel = factory.buildViewerPanel();

// add copy keyboard command
        ComponentKeyBinding.install(controller, viewerComponentPanel);

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

        controller.openDocument(filePath);
    }
}

Below is the method that calls the code above
public void viewFile(){
String canonicalPath = tempFileHolder.get(scriptName);
            viewPDF vw = new viewPDF();
            vw.displayPDF(jPanelGrader,canonicalPath);
}

【问题讨论】:

    标签: java pdf view icepdf


    【解决方案1】:

    这不是错误,只是警告。通常是因为icepdf的开源版本缺少写支持,只有core和viewer。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-12-17
      • 2014-07-30
      • 2016-02-04
      • 2017-09-12
      • 2014-05-29
      • 2013-07-22
      • 1970-01-01
      相关资源
      最近更新 更多