Example usage for com.lowagie.text.pdf PdfName PAGES

List of usage examples for com.lowagie.text.pdf PdfName PAGES

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfName PAGES.

Prototype

PdfName PAGES

To view the source code for com.lowagie.text.pdf PdfName PAGES.

Click Source Link

Document

A name

Usage

From source file:it.flavianopetrocchi.jpdfbookmarks.itextbookmarksconverter.iTextBookmarksConverter.java

License:Open Source License

private static int getNumber(PdfIndirectReference indirect) {
    PdfDictionary pdfObj = (PdfDictionary) PdfReader.getPdfObjectRelease(indirect);
    if (pdfObj.contains(PdfName.TYPE) && pdfObj.get(PdfName.TYPE).equals(PdfName.PAGES)
            && pdfObj.contains(PdfName.KIDS)) {
        PdfArray kids = (PdfArray) pdfObj.get(PdfName.KIDS);
        indirect = (PdfIndirectReference) kids.getPdfObject(0);
    }//from w ww . j  a v  a2s.c om
    return indirect.getNumber();
}