Example usage for com.lowagie.text.pdf PdfIndirectReference getNumber

List of usage examples for com.lowagie.text.pdf PdfIndirectReference getNumber

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfIndirectReference getNumber.

Prototype


public int getNumber() 

Source Link

Document

Returns the number of the object.

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);
    }//  w  w  w . j a  va 2 s. c om
    return indirect.getNumber();
}