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

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

Introduction

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

Prototype

PdfName TITLE

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

Click Source Link

Document

Use Title for the document's top level title (optional), and for document outline dictionaries, which can store bookmarks.

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.
 * /* w  w w . j av a  2  s  .com*/
 * @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
}