2

Please friends I am encountering this difficulty viewing a pdf file, it is given the error below

org.icepdf.core.pobjects.Document WARNING: PDF write support was not found on the class path Jun 09, 2017 8:32:10 AM org.icepdf.core.pobjects.Catalog

Below is my code

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);
}

1 Answers1

1

That' not an error, just a warning. Usually because the open-source version of icepdf is missing the write support, only core and viewer.

ugo
  • 284
  • 1
  • 2
  • 10