Example usage for com.lowagie.text.pdf PdfName NEXT

List of usage examples for com.lowagie.text.pdf PdfName NEXT

Introduction

In this page you can find the example usage for com.lowagie.text.pdf PdfName NEXT.

Prototype

PdfName NEXT

To view the source code for com.lowagie.text.pdf PdfName NEXT.

Click Source Link

Document

A name

Usage

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

License:LGPL

/**
 * This method will populate the text bookmark list.
 * // w ww  . ja  v  a  2s .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
}

From source file:it.flavianopetrocchi.jpdfbookmarks.itextbookmarksconverter.iTextBookmarksConverter.java

License:Open Source License

private void setActionsRecursive(Bookmark bookmark, PdfDictionary action) {

    setActionInBookmark(bookmark, action);

    PdfObject next = PdfReader.getPdfObjectRelease(action.get(PdfName.NEXT));
    if (next != null) {
        if (next.isArray()) {
            PdfArray actions = (PdfArray) next;
            for (int i = 0; i < actions.size(); i++) {
                Bookmark b = new Bookmark();
                action = actions.getAsDict(i);
                setActionsRecursive(b, action);
                bookmark.addChainedBookmark(b);
            }/*from   w w w.j  a  va2s  . co m*/
        } else if (next.isDictionary()) {
            Bookmark b = new Bookmark();
            action = (PdfDictionary) next;
            setActionsRecursive(b, action);
            bookmark.addChainedBookmark(b);
        }
    }
}

From source file:it.flavianopetrocchi.jpdfbookmarks.itextbookmarksconverter.iTextBookmarksConverter.java

License:Open Source License

private void bookmarkDepth(Bookmark father, PdfDictionary outline) {
    Bookmark bookmark = null;/*from   w w  w .j av a 2 s .c o m*/
    while (outline != null) {
        bookmark = bookmarkFromDictionary(outline);
        PdfDictionary first = (PdfDictionary) PdfReader.getPdfObjectRelease(outline.get(PdfName.FIRST));
        if (first != null) {
            bookmarkDepth(bookmark, first);
        }
        father.add(bookmark);
        outline = (PdfDictionary) PdfReader.getPdfObjectRelease(outline.get(PdfName.NEXT));
    }

}