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

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

Introduction

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

Prototype

PdfName FIRST

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

Click Source Link

Document

A name

Usage

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

License:GNU General Public License

/**
 * This method will populate the text bookmark list.
 * //from w  w w  . j  a  v  a2s  .  c  o  m
 * @param rootOutlinesPdfDictionary The node element for the bookmark item.
 * @param indentionString The base indention string to be used.
 */
@SuppressWarnings("unchecked")
private void populateBookmarkTextList(PdfDictionary rootOutlinesPdfDictionary, String indentionString) {
    PdfDictionary outlineItemPdfDictionary = (PdfDictionary) PdfReader
            .getPdfObjectRelease(rootOutlinesPdfDictionary.get(PdfName.FIRST));
    while (outlineItemPdfDictionary != null) {
        PdfString bookmarkTitle = (PdfString) PdfReader
                .getPdfObjectRelease(outlineItemPdfDictionary.get(PdfName.TITLE));
        bookmarkTextList.add(indentionString + bookmarkTitle.toUnicodeString());
        logger.trace(indentionString + bookmarkTitle.toUnicodeString());

        /*
         * Recursive call to fill List
         */
        populateBookmarkTextList(outlineItemPdfDictionary, indentionString + bookmarkIndentionString());

        /*
         * Get next outline item
         */
        outlineItemPdfDictionary = (PdfDictionary) PdfReader
                .getPdfObjectRelease(outlineItemPdfDictionary.get(PdfName.NEXT));
    } // end while
}