Example usage for com.itextpdf.text.pdf PdfName OUTLINES

List of usage examples for com.itextpdf.text.pdf PdfName OUTLINES

Introduction

In this page you can find the example usage for com.itextpdf.text.pdf PdfName OUTLINES.

Prototype

PdfName OUTLINES

To view the source code for com.itextpdf.text.pdf PdfName OUTLINES.

Click Source Link

Document

A name

Usage

From source file:de.offis.health.icardea.cied.pdf.extractor.PDFiText5Extractor.java

License:GNU General Public License

@SuppressWarnings("unchecked")
public java.util.List getBookmarkTitlesAsText() {
    java.util.List bookmarkContent = null;
    if (pdfReader != null) {
        //bookmarkContent = SimpleBookmark.getBookmark(pdfReader);

        PdfDictionary catalog = pdfReader.getCatalog();
        if (catalog != null) {
            PdfObject rootPdfObject = PdfReader.getPdfObjectRelease(catalog.get(PdfName.OUTLINES));
            if (rootPdfObject != null && rootPdfObject.isDictionary()) {
                PdfDictionary rootOutlinesPdfDictionary = (PdfDictionary) rootPdfObject;
                /*/*  w w  w  .  j  a v  a2 s.  co  m*/
                 * If it doesn't exist create the List and populate it,
                 * otherwise just return the already existing List.
                 */
                if (bookmarkTextList == null) {
                    bookmarkTextList = new ArrayList<String>();

                    // Populate the List
                    populateBookmarkTextList(rootOutlinesPdfDictionary, "");
                } // end if

            }
        } // end if
    }
    return bookmarkContent;
}