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

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

Introduction

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

Prototype

PdfName USEOUTLINES

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

Click Source Link

Document

A name

Usage

From source file:net.mitnet.tools.pdf.book.pdf.util.PdfBookmarkBuilder.java

License:Open Source License

public void addBookmarks(String inputPdfFile, List<HashMap<String, Object>> bookmarks, String outputPdfFile)
        throws IOException, DocumentException {

    PdfReader reader = new PdfReader(inputPdfFile);

    PdfStamper stamper = new PdfStamper(reader, new FileOutputStream(outputPdfFile));

    if (bookmarks != null) {
        System.out.println("bookmarks.size: " + bookmarks.size());
    }/*from w  ww .  j  a  va2  s  . c o  m*/
    System.out.println("bookmarks: " + bookmarks);

    stamper.setOutlines(bookmarks);

    stamper.addViewerPreference(PdfName.NONFULLSCREENPAGEMODE, PdfName.USEOUTLINES);

    stamper.close();
}