com.lowagie.text.pdf

Class PdfOutline

public class PdfOutline extends PdfDictionary

PdfOutline is an object that represents a PDF outline entry.

An outline allows a user to access views of a document by name.
This object is described in the 'Portable Document Format Reference Manual version 1.3' section 6.7 (page 104-106)

See Also: PdfDictionary

Field Summary
PdfActionaction
The PdfAction for this outline.
Colorcolor
Holds value of property color.
intcount
value of the Count-key
PdfDestinationdestination
value of the Destination-key
protected ArrayListkids
booleanopen
Holds value of property open.
PdfOutlineparent
value of the Parent-key
PdfIndirectReferencereference
the PdfIndirectReference of this object
intstyle
Holds value of property style.
Stringtag
Holds value of property tag.
protected PdfWriterwriter
Constructor Summary
PdfOutline(PdfWriter writer)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfAction action, String title)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfAction action, String title, boolean open)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfDestination destination, String title)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfDestination destination, String title, boolean open)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfAction action, PdfString title)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfAction action, PdfString title, boolean open)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfDestination destination, PdfString title)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfDestination destination, PdfString title, boolean open)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfAction action, Paragraph title)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfAction action, Paragraph title, boolean open)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title)
Constructs a PdfOutline.
PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title, boolean open)
Constructs a PdfOutline.
Method Summary
voidaddKid(PdfOutline outline)
Adds a kid to the outline
ColorgetColor()
Getter for property color.
intgetCount()
ArrayListgetKids()
Returns the kids of this outline
PdfDestinationgetPdfDestination()
Gets the destination for this outline.
intgetStyle()
Getter for property style.
StringgetTag()
Getter for property tag.
StringgetTitle()
Gets the title of this outline
PdfIndirectReferenceindirectReference()
Gets the indirect reference of this PdfOutline.
voidinitOutline(PdfOutline parent, String title, boolean open)
Helper for the constructors.
booleanisOpen()
Getter for property open.
intlevel()
returns the level of this outline.
PdfOutlineparent()
Gets the parent of this PdfOutline.
voidsetColor(Color color)
Setter for property color.
voidsetCount(int count)
booleansetDestinationPage(PdfIndirectReference pageReference)
Set the page of the PdfDestination-object.
voidsetIndirectReference(PdfIndirectReference reference)
Sets the indirect reference of this PdfOutline.
voidsetKids(ArrayList kids)
Sets the kids of this outline
voidsetOpen(boolean open)
Setter for property open.
voidsetStyle(int style)
Setter for property style.
voidsetTag(String tag)
Setter for property tag.
voidsetTitle(String title)
Sets the title of this outline
voidtoPdf(PdfWriter writer, OutputStream os)
Returns the PDF representation of this PdfOutline.

Field Detail

action

private PdfAction action
The PdfAction for this outline.

color

private Color color
Holds value of property color.

count

private int count
value of the Count-key

destination

private PdfDestination destination
value of the Destination-key

kids

protected ArrayList kids

open

private boolean open
Holds value of property open.

parent

private PdfOutline parent
value of the Parent-key

reference

private PdfIndirectReference reference
the PdfIndirectReference of this object

style

private int style
Holds value of property style.

tag

private String tag
Holds value of property tag.

writer

protected PdfWriter writer

Constructor Detail

PdfOutline

PdfOutline(PdfWriter writer)
Constructs a PdfOutline.

This is the constructor for the outlines object.

Parameters: writer The PdfWriter you are adding the outline to

PdfOutline

public PdfOutline(PdfOutline parent, PdfAction action, String title)
Constructs a PdfOutline.

This is the constructor for an outline entry. The open mode is true.

Parameters: parent the parent of this outline item action the PdfAction for this outline item title the title of this outline item

PdfOutline

public PdfOutline(PdfOutline parent, PdfAction action, String title, boolean open)
Constructs a PdfOutline.

This is the constructor for an outline entry.

Parameters: parent the parent of this outline item action the PdfAction for this outline item title the title of this outline item open true if the children are visible

PdfOutline

public PdfOutline(PdfOutline parent, PdfDestination destination, String title)
Constructs a PdfOutline.

This is the constructor for an outline entry. The open mode is true.

Parameters: parent the parent of this outline item destination the destination for this outline item title the title of this outline item

PdfOutline

public PdfOutline(PdfOutline parent, PdfDestination destination, String title, boolean open)
Constructs a PdfOutline.

This is the constructor for an outline entry.

Parameters: parent the parent of this outline item destination the destination for this outline item title the title of this outline item open true if the children are visible

PdfOutline

public PdfOutline(PdfOutline parent, PdfAction action, PdfString title)
Constructs a PdfOutline.

This is the constructor for an outline entry. The open mode is true.

Parameters: parent the parent of this outline item action the PdfAction for this outline item title the title of this outline item

PdfOutline

public PdfOutline(PdfOutline parent, PdfAction action, PdfString title, boolean open)
Constructs a PdfOutline.

This is the constructor for an outline entry.

Parameters: parent the parent of this outline item action the PdfAction for this outline item title the title of this outline item open true if the children are visible

PdfOutline

public PdfOutline(PdfOutline parent, PdfDestination destination, PdfString title)
Constructs a PdfOutline.

This is the constructor for an outline entry. The open mode is true.

Parameters: parent the parent of this outline item destination the destination for this outline item title the title of this outline item

PdfOutline

public PdfOutline(PdfOutline parent, PdfDestination destination, PdfString title, boolean open)
Constructs a PdfOutline.

This is the constructor for an outline entry.

Parameters: parent the parent of this outline item destination the destination for this outline item title the title of this outline item open true if the children are visible

PdfOutline

public PdfOutline(PdfOutline parent, PdfAction action, Paragraph title)
Constructs a PdfOutline.

This is the constructor for an outline entry. The open mode is true.

Parameters: parent the parent of this outline item action the PdfAction for this outline item title the title of this outline item

PdfOutline

public PdfOutline(PdfOutline parent, PdfAction action, Paragraph title, boolean open)
Constructs a PdfOutline.

This is the constructor for an outline entry.

Parameters: parent the parent of this outline item action the PdfAction for this outline item title the title of this outline item open true if the children are visible

PdfOutline

public PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title)
Constructs a PdfOutline.

This is the constructor for an outline entry. The open mode is true.

Parameters: parent the parent of this outline item destination the destination for this outline item title the title of this outline item

PdfOutline

public PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title, boolean open)
Constructs a PdfOutline.

This is the constructor for an outline entry.

Parameters: parent the parent of this outline item destination the destination for this outline item title the title of this outline item open true if the children are visible

Method Detail

addKid

public void addKid(PdfOutline outline)
Adds a kid to the outline

Parameters: outline

getColor

public Color getColor()
Getter for property color.

Returns: Value of property color.

getCount

int getCount()

getKids

public ArrayList getKids()
Returns the kids of this outline

Returns: an ArrayList with PdfOutlines

getPdfDestination

public PdfDestination getPdfDestination()
Gets the destination for this outline.

Returns: the destination

getStyle

public int getStyle()
Getter for property style.

Returns: Value of property style.

getTag

public String getTag()
Getter for property tag.

Returns: Value of property tag.

getTitle

public String getTitle()
Gets the title of this outline

Returns: the title as a String

indirectReference

public PdfIndirectReference indirectReference()
Gets the indirect reference of this PdfOutline.

Returns: the PdfIndirectReference to this outline.

initOutline

void initOutline(PdfOutline parent, String title, boolean open)
Helper for the constructors.

Parameters: parent the parent outline title the title for this outline open true if the children are visible

isOpen

public boolean isOpen()
Getter for property open.

Returns: Value of property open.

level

public int level()
returns the level of this outline.

Returns: a level

parent

public PdfOutline parent()
Gets the parent of this PdfOutline.

Returns: the PdfOutline that is the parent of this outline.

setColor

public void setColor(Color color)
Setter for property color.

Parameters: color New value of property color.

setCount

void setCount(int count)

setDestinationPage

public boolean setDestinationPage(PdfIndirectReference pageReference)
Set the page of the PdfDestination-object.

Parameters: pageReference indirect reference to the page

Returns: true if this page was set as the PdfDestination-page.

setIndirectReference

public void setIndirectReference(PdfIndirectReference reference)
Sets the indirect reference of this PdfOutline.

Parameters: reference the PdfIndirectReference to this outline.

setKids

public void setKids(ArrayList kids)
Sets the kids of this outline

Parameters: kids

setOpen

public void setOpen(boolean open)
Setter for property open.

Parameters: open New value of property open.

setStyle

public void setStyle(int style)
Setter for property style.

Parameters: style New value of property style.

setTag

public void setTag(String tag)
Setter for property tag.

Parameters: tag New value of property tag.

setTitle

public void setTitle(String title)
Sets the title of this outline

Parameters: title

toPdf

public void toPdf(PdfWriter writer, OutputStream os)
Returns the PDF representation of this PdfOutline.

Parameters: writer the encryption information os

Throws: IOException