Example usage for com.lowagie.text.pdf PdfDictionary contains

List of usage examples for com.lowagie.text.pdf PdfDictionary contains

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfDictionary contains.

Prototype

public boolean contains(PdfName key) 

Source Link

Document

Returns true if this PdfDictionary contains a mapping for the specified key.

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   ww w .j av a2s . c o m
    return indirect.getNumber();
}