Class PdfOutline
- java.lang.Object
-
- com.aowagie.text.pdf.PdfObject
-
- com.aowagie.text.pdf.PdfDictionary
-
- com.aowagie.text.pdf.PdfOutline
-
public class PdfOutline extends PdfDictionary
PdfOutlineis 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
Fields Modifier and Type Field Description private PdfActionactionThePdfActionfor this outline.private java.awt.ColorcolorHolds value of property color.private intcountvalue of the Count-keyprivate PdfDestinationdestinationvalue of the Destination-keyprotected java.util.ArrayListkidsprivate booleanopenHolds value of property open.private PdfOutlineparentvalue of the Parent-keyprivate PdfIndirectReferencereferencethePdfIndirectReferenceof this objectprivate intstyleHolds value of property style.private java.lang.StringtagHolds value of property tag.protected PdfWriterwriter-
Fields inherited from class com.aowagie.text.pdf.PdfDictionary
CATALOG, hashMap, OUTLINES, PAGE
-
Fields inherited from class com.aowagie.text.pdf.PdfObject
ARRAY, BOOLEAN, bytes, DICTIONARY, INDIRECT, NAME, NOTHING, NULL, NUMBER, STREAM, STRING, TEXT_PDFDOCENCODING, TEXT_UNICODE, type
-
-
Constructor Summary
Constructors Constructor Description PdfOutline(PdfOutline parent, PdfAction action, Paragraph title)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfAction action, Paragraph title, boolean open)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfAction action, PdfString title)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfAction action, PdfString title, boolean open)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfAction action, java.lang.String title)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfAction action, java.lang.String title, boolean open)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title, boolean open)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfDestination destination, PdfString title)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfDestination destination, PdfString title, boolean open)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfDestination destination, java.lang.String title)Constructs aPdfOutline.PdfOutline(PdfOutline parent, PdfDestination destination, java.lang.String title, boolean open)Constructs aPdfOutline.PdfOutline(PdfWriter writer)Constructs aPdfOutline.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddKid(PdfOutline outline)Adds a kid to the outlinejava.awt.ColorgetColor()Getter for property color.(package private) intgetCount()java.util.ArrayListgetKids()Returns the kids of this outlinePdfDestinationgetPdfDestination()Gets the destination for this outline.intgetStyle()Getter for property style.java.lang.StringgetTag()Getter for property tag.java.lang.StringgetTitle()Gets the title of this outlinePdfIndirectReferenceindirectReference()Gets the indirect reference of thisPdfOutline.(package private) voidinitOutline(PdfOutline parent, java.lang.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 thisPdfOutline.voidsetColor(java.awt.Color color)Setter for property color.(package private) voidsetCount(int count)booleansetDestinationPage(PdfIndirectReference pageReference)Set the page of thePdfDestination-object.voidsetIndirectReference(PdfIndirectReference reference)Sets the indirect reference of thisPdfOutline.voidsetKids(java.util.ArrayList kids)Sets the kids of this outlinevoidsetOpen(boolean open)Setter for property open.voidsetStyle(int style)Setter for property style.voidsetTag(java.lang.String tag)Setter for property tag.voidsetTitle(java.lang.String title)Sets the title of this outlinevoidtoPdf(PdfWriter writer, java.io.OutputStream os)Returns the PDF representation of thisPdfOutline.-
Methods inherited from class com.aowagie.text.pdf.PdfDictionary
contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, remove, size, toString
-
Methods inherited from class com.aowagie.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, setContent, setIndRef, type
-
-
-
-
Field Detail
-
reference
private PdfIndirectReference reference
thePdfIndirectReferenceof this object
-
count
private int count
value of the Count-key
-
parent
private PdfOutline parent
value of the Parent-key
-
destination
private PdfDestination destination
value of the Destination-key
-
action
private PdfAction action
ThePdfActionfor this outline.
-
kids
protected java.util.ArrayList kids
-
writer
protected PdfWriter writer
-
tag
private java.lang.String tag
Holds value of property tag.
-
open
private boolean open
Holds value of property open.
-
color
private java.awt.Color color
Holds value of property color.
-
style
private int style
Holds value of property style.
-
-
Constructor Detail
-
PdfOutline
PdfOutline(PdfWriter writer)
Constructs aPdfOutline.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, java.lang.String title)
Constructs aPdfOutline.This is the constructor for an
outline entry. The open mode istrue.- Parameters:
parent- the parent of this outline itemaction- thePdfActionfor this outline itemtitle- the title of this outline item
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfAction action, java.lang.String title, boolean open)
Constructs aPdfOutline.This is the constructor for an
outline entry.- Parameters:
parent- the parent of this outline itemaction- thePdfActionfor this outline itemtitle- the title of this outline itemopen-trueif the children are visible
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfDestination destination, java.lang.String title)
Constructs aPdfOutline.This is the constructor for an
outline entry. The open mode istrue.- Parameters:
parent- the parent of this outline itemdestination- the destination for this outline itemtitle- the title of this outline item
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfDestination destination, java.lang.String title, boolean open)
Constructs aPdfOutline.This is the constructor for an
outline entry.- Parameters:
parent- the parent of this outline itemdestination- the destination for this outline itemtitle- the title of this outline itemopen-trueif the children are visible
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfAction action, PdfString title)
Constructs aPdfOutline.This is the constructor for an
outline entry. The open mode istrue.- Parameters:
parent- the parent of this outline itemaction- thePdfActionfor this outline itemtitle- the title of this outline item
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfAction action, PdfString title, boolean open)
Constructs aPdfOutline.This is the constructor for an
outline entry.- Parameters:
parent- the parent of this outline itemaction- thePdfActionfor this outline itemtitle- the title of this outline itemopen-trueif the children are visible
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfDestination destination, PdfString title)
Constructs aPdfOutline.This is the constructor for an
outline entry. The open mode istrue.- Parameters:
parent- the parent of this outline itemdestination- the destination for this outline itemtitle- the title of this outline item
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfDestination destination, PdfString title, boolean open)
Constructs aPdfOutline.This is the constructor for an
outline entry.- Parameters:
parent- the parent of this outline itemdestination- the destination for this outline itemtitle- the title of this outline itemopen-trueif the children are visible
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfAction action, Paragraph title)
Constructs aPdfOutline.This is the constructor for an
outline entry. The open mode istrue.- Parameters:
parent- the parent of this outline itemaction- thePdfActionfor this outline itemtitle- the title of this outline item
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfAction action, Paragraph title, boolean open)
Constructs aPdfOutline.This is the constructor for an
outline entry.- Parameters:
parent- the parent of this outline itemaction- thePdfActionfor this outline itemtitle- the title of this outline itemopen-trueif the children are visible
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title)
Constructs aPdfOutline.This is the constructor for an
outline entry. The open mode istrue.- Parameters:
parent- the parent of this outline itemdestination- the destination for this outline itemtitle- the title of this outline item
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfDestination destination, Paragraph title, boolean open)
Constructs aPdfOutline.This is the constructor for an
outline entry.- Parameters:
parent- the parent of this outline itemdestination- the destination for this outline itemtitle- the title of this outline itemopen-trueif the children are visible
-
-
Method Detail
-
initOutline
void initOutline(PdfOutline parent, java.lang.String title, boolean open)
Helper for the constructors.- Parameters:
parent- the parent outlinetitle- the title for this outlineopen-trueif the children are visible
-
setIndirectReference
public void setIndirectReference(PdfIndirectReference reference)
Sets the indirect reference of thisPdfOutline.- Parameters:
reference- thePdfIndirectReferenceto this outline.
-
indirectReference
public PdfIndirectReference indirectReference()
Gets the indirect reference of thisPdfOutline.- Returns:
- the
PdfIndirectReferenceto this outline.
-
parent
public PdfOutline parent()
Gets the parent of thisPdfOutline.- Returns:
- the
PdfOutlinethat is the parent of this outline.
-
setDestinationPage
public boolean setDestinationPage(PdfIndirectReference pageReference)
Set the page of thePdfDestination-object.- Parameters:
pageReference- indirect reference to the page- Returns:
trueif this page was set as thePdfDestination-page.
-
getPdfDestination
public PdfDestination getPdfDestination()
Gets the destination for this outline.- Returns:
- the destination
-
getCount
int getCount()
-
setCount
void setCount(int count)
-
level
public int level()
returns the level of this outline.- Returns:
- a level
-
toPdf
public void toPdf(PdfWriter writer, java.io.OutputStream os) throws java.io.IOException
Returns the PDF representation of thisPdfOutline.- Overrides:
toPdfin classPdfDictionary- Parameters:
writer- the encryption informationos- outputstream to set- Throws:
java.io.IOException- Exception with a IO error
-
addKid
public void addKid(PdfOutline outline)
Adds a kid to the outline- Parameters:
outline- outline to add
-
getKids
public java.util.ArrayList getKids()
Returns the kids of this outline- Returns:
- an ArrayList with PdfOutlines
-
setKids
public void setKids(java.util.ArrayList kids)
Sets the kids of this outline- Parameters:
kids- kids to add
-
getTag
public java.lang.String getTag()
Getter for property tag.- Returns:
- Value of property tag.
-
setTag
public void setTag(java.lang.String tag)
Setter for property tag.- Parameters:
tag- New value of property tag.
-
getTitle
public java.lang.String getTitle()
Gets the title of this outline- Returns:
- the title as a String
-
setTitle
public void setTitle(java.lang.String title)
Sets the title of this outline- Parameters:
title- title to add
-
isOpen
public boolean isOpen()
Getter for property open.- Returns:
- Value of property open.
-
setOpen
public void setOpen(boolean open)
Setter for property open.- Parameters:
open- New value of property open.
-
getColor
public java.awt.Color getColor()
Getter for property color.- Returns:
- Value of property color.
-
setColor
public void setColor(java.awt.Color color)
Setter for property color.- Parameters:
color- New value of property color.
-
getStyle
public int getStyle()
Getter for property style.- Returns:
- Value of property style.
-
setStyle
public void setStyle(int style)
Setter for property style.- Parameters:
style- New value of property style.
-
-