Class PdfOutline
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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate PdfAction
ThePdfAction
for this outline.private Color
Holds value of property color.private int
value of the Count-keyprivate PdfDestination
value of the Destination-keyprotected List
<PdfOutline> private boolean
Holds value of property open.private PdfOutline
value of the Parent-keyprivate PdfIndirectReference
thePdfIndirectReference
of this objectprivate int
Holds value of property style.private String
Holds value of property tag.protected PdfWriter
-
Constructor Summary
ConstructorsConstructorDescriptionPdfOutline
(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, String title) Constructs aPdfOutline
.PdfOutline
(PdfOutline parent, PdfAction action, 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, String title) Constructs aPdfOutline
.PdfOutline
(PdfOutline parent, PdfDestination destination, String title, boolean open) Constructs aPdfOutline
.PdfOutline
(PdfWriter writer) Constructs aPdfOutline
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addKid
(PdfOutline outline) Adds a kid to the outlinegetColor()
Getter for property color.(package private) int
getCount()
getKids()
Returns the kids of this outlineGets the destination for this outline.int
getStyle()
Getter for property style.getTag()
Getter for property tag.getTitle()
Gets the title of this outlineGets the indirect reference of thisPdfOutline
.(package private) void
initOutline
(PdfOutline parent, String title, boolean open) Helper for the constructors.boolean
isOpen()
Getter for property open.int
level()
returns the level of this outline.parent()
Gets the parent of thisPdfOutline
.void
Setter for property color.(package private) void
setCount
(int count) boolean
setDestinationPage
(PdfIndirectReference pageReference) Set the page of thePdfDestination
-object.void
setIndirectReference
(PdfIndirectReference reference) Sets the indirect reference of thisPdfOutline
.void
setKids
(List<PdfOutline> kids) Sets the kids of this outlinevoid
setOpen
(boolean open) Setter for property open.void
setStyle
(int style) Setter for property style.void
Setter for property tag.void
Sets the title of this outlinevoid
toPdf
(PdfWriter writer, OutputStream os) Returns the PDF representation of thisPdfOutline
.Methods inherited from class com.lowagie.text.pdf.PdfDictionary
clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, getKeysAndValues, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toString
Methods inherited from class com.lowagie.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
Field Details
-
kids
-
writer
-
reference
thePdfIndirectReference
of this object -
count
private int countvalue of the Count-key -
parent
value of the Parent-key -
destination
value of the Destination-key -
action
ThePdfAction
for this outline. -
tag
Holds value of property tag. -
open
private boolean openHolds value of property open. -
color
Holds value of property color. -
style
private int styleHolds value of property style.
-
-
Constructor Details
-
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
Constructs aPdfOutline
.This is the constructor for an
outline entry
. The open mode istrue
.- Parameters:
parent
- the parent of this outline itemaction
- thePdfAction
for this outline itemtitle
- the title of this outline item
-
PdfOutline
Constructs aPdfOutline
.This is the constructor for an
outline entry
.- Parameters:
parent
- the parent of this outline itemaction
- thePdfAction
for this outline itemtitle
- the title of this outline itemopen
-true
if the children are visible
-
PdfOutline
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
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
-true
if the children are visible
-
PdfOutline
Constructs aPdfOutline
.This is the constructor for an
outline entry
. The open mode istrue
.- Parameters:
parent
- the parent of this outline itemaction
- thePdfAction
for this outline itemtitle
- the title of this outline item
-
PdfOutline
Constructs aPdfOutline
.This is the constructor for an
outline entry
.- Parameters:
parent
- the parent of this outline itemaction
- thePdfAction
for this outline itemtitle
- the title of this outline itemopen
-true
if the children are visible
-
PdfOutline
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
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
-true
if the children are visible
-
PdfOutline
Constructs aPdfOutline
.This is the constructor for an
outline entry
. The open mode istrue
.- Parameters:
parent
- the parent of this outline itemaction
- thePdfAction
for this outline itemtitle
- the title of this outline item
-
PdfOutline
Constructs aPdfOutline
.This is the constructor for an
outline entry
.- Parameters:
parent
- the parent of this outline itemaction
- thePdfAction
for this outline itemtitle
- the title of this outline itemopen
-true
if the children are visible
-
PdfOutline
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
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
-true
if the children are visible
-
-
Method Details
-
initOutline
Helper for the constructors.- Parameters:
parent
- the parent outlinetitle
- the title for this outlineopen
-true
if the children are visible
-
setIndirectReference
Sets the indirect reference of thisPdfOutline
.- Parameters:
reference
- thePdfIndirectReference
to this outline.
-
indirectReference
Gets the indirect reference of thisPdfOutline
.- Returns:
- the
PdfIndirectReference
to this outline.
-
parent
Gets the parent of thisPdfOutline
.- Returns:
- the
PdfOutline
that is the parent of this outline.
-
setDestinationPage
Set the page of thePdfDestination
-object.- Parameters:
pageReference
- indirect reference to the page- Returns:
true
if this page was set as thePdfDestination
-page.
-
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
Returns the PDF representation of thisPdfOutline
.- Overrides:
toPdf
in classPdfDictionary
- Parameters:
writer
- the encryption informationos
- the OutputStream o write the bytes to- Throws:
IOException
- on error of super.toPdf()
-
addKid
Adds a kid to the outline- Parameters:
outline
- the PdfOutline to add a kid to
-
getKids
Returns the kids of this outline- Returns:
- an ArrayList with PdfOutlines
-
setKids
Sets the kids of this outline- Parameters:
kids
- the kids of the outline
-
getTag
Getter for property tag.- Returns:
- Value of property tag.
-
setTag
Setter for property tag.- Parameters:
tag
- New value of property tag.
-
getTitle
Gets the title of this outline- Returns:
- the title as a String
-
setTitle
Sets the title of this outline- Parameters:
title
- the title of the outline
-
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
Getter for property color.- Returns:
- Value of property color.
-
setColor
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.
-