Top Description Constructors Methods
org.apache.pdfbox.examples.pdmodel

public Class PrintBookmarks

extends Object
Class Inheritance
Imports
java.io.File, .IOException, org.apache.pdfbox.Loader, org.apache.pdfbox.pdmodel.PDDocument, org.apache.pdfbox.pdmodel.interactive.action.PDActionGoTo, org.apache.pdfbox.pdmodel.interactive.documentnavigation.destination.PDNamedDestination, .PDPageDestination, org.apache.pdfbox.pdmodel.interactive.documentnavigation.outline.PDDocumentOutline, .PDOutlineItem, .PDOutlineNode

This is an example on how to access the bookmarks that are part of a pdf document.
Author
Ben Litchfield

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
main(String[]
The command line arguments.
args
)

This will print the documents data.

public void
printBookmark(PDDocument
The document.
document
,
PDOutlineNode
The bookmark to print out.
bookmark
,
String
A pretty printing parameter
indentation
)

This will print the documents bookmarks to System.out.

private static void
usage()

This will print the usage for this document.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

PrintBookmarksback to summary
public PrintBookmarks()

Method Detail

mainback to summary
public static void main(String[] args) throws IOException

This will print the documents data.

Parameters
args:String[]

The command line arguments.

Exceptions
IOException:
If there is an error parsing the document.
printBookmarkback to summary
public void printBookmark(PDDocument document, PDOutlineNode bookmark, String indentation) throws IOException

This will print the documents bookmarks to System.out.

Parameters
document:PDDocument

The document.

bookmark:PDOutlineNode

The bookmark to print out.

indentation:String

A pretty printing parameter

Exceptions
IOException:
If there is an error getting the page count.
usageback to summary
private static void usage()

This will print the usage for this document.