Hi guys.
Thanks for the good job done on Apache PDFBox
However, checking the version 2.0 change log at http://pdfbox
.apache.org/2.0/migration.html , I found out nothing was mentioned about
*PDFPagePanel* class which use to be on version 1.8 as I have in the API
doc of 1.8. Please do mail me an update on this as this is the first time
I'm using this Library. For now, I may have to download the stable version
1.8

However in 1.8 I am experiencing an issue displaying pdf. I have these
lines of codes that I have being trying to use to read pdf file with Apache
pdfBox.

private void readPdf(){
    try {
        File PDF_Path = new File("/home/olyjosh/Downloads/my project.pdf");
        PDDocument inputPDF = PDDocument.load(PDF_Path);
        List<PDPage> allPages = inputPDF.getDocumentCatalog().getAllPages();
        PDPage testPage = (PDPage) allPages.get(5);
        System.out.println("Number of pages "+allPages.size());

        PDFPagePanel pdfPanel = new PDFPagePanel();
        jPanel1.add(pdfPanel);
        pdfPanel.setPage(testPage);

//            this.revalidate();
        inputPDF.close();
    } catch (IOException ex) {
        Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);
    }
}

I want this pdf to be displayed on swing component like jPanel but this
will only display the panel without the expected content of the pdf file(
It went blank, just white pane displayed)

Best Regards

Reply via email to