Example usage for org.apache.pdfbox.pdmodel PDPageTree iterator

List of usage examples for org.apache.pdfbox.pdmodel PDPageTree iterator

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel PDPageTree iterator.

Prototype

@Override
public Iterator<PDPage> iterator() 

Source Link

Document

Returns an iterator which walks all pages in the tree, in order.

Usage

From source file:uk.org.openeyes.PDFFunctions.java

/**
 *
 * @param PDFDoc/*from   w ww  .  j  a  va  2s . c o  m*/
 * @throws IOException
 */
public void dumpPDFContent(PDDocument PDFDoc) throws IOException {
    PDPageTree allPages;
    allPages = PDFDoc.getDocumentCatalog().getPages();

    PDPage currentPage;
    Iterator pages = allPages.iterator();
    while (pages.hasNext()) {
        currentPage = (PDPage) pages.next();
        String pageTitle = getPageTitleIOLM700(currentPage).trim();
        System.out.println(pageTitle);
        if (pageTitle.equals("IOL calculation") || pageTitle.equals("IOL calculation (Multiformula)")) {
            System.out.println("Extracting calculation values");
            System.out.println(getTopLensFormulaNameIOLM700(currentPage));
            for (int i = 1; i <= 4; i++) {
                System.out.println("Right " + i);
                System.out.println(getMultiLensFormulaNamesIOLM700(currentPage, "R", i));
                System.out.println(getMultiLensAValuesIOLM700(currentPage, "R", i));
                System.out.println(dumpIOLREFValuesIOLM700(currentPage, "R", i));
                System.out.println("Left " + i);
                System.out.println(getMultiLensFormulaNamesIOLM700(currentPage, "L", i));
                System.out.println(getMultiLensAValuesIOLM700(currentPage, "L", i));
                System.out.println(dumpIOLREFValuesIOLM700(currentPage, "L", i));
            }
        }
    }
}