Class PdfOutline
- java.lang.Object
-
- com.itextpdf.text.pdf.PdfObject
-
- com.itextpdf.text.pdf.PdfDictionary
-
- com.itextpdf.text.pdf.PdfOutline
-
- All Implemented Interfaces:
Serializable
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
, Serialized Form
-
-
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, 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
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addKid(PdfOutline outline)
Adds a kid to the outlineBaseColor
getColor()
Getter for property color.ArrayList<PdfOutline>
getKids()
Returns the kids of this outlinePdfDestination
getPdfDestination()
Gets the destination for this outline.int
getStyle()
Getter for property style.String
getTag()
Getter for property tag.String
getTitle()
Gets the title of this outlinePdfIndirectReference
indirectReference()
Gets the indirect reference of thisPdfOutline
.boolean
isOpen()
Getter for property open.int
level()
returns the level of this outline.PdfOutline
parent()
Gets the parent of thisPdfOutline
.void
setColor(BaseColor color)
Setter for property color.boolean
setDestinationPage(PdfIndirectReference pageReference)
Set the page of thePdfDestination
-object.void
setIndirectReference(PdfIndirectReference reference)
Sets the indirect reference of thisPdfOutline
.void
setKids(ArrayList<PdfOutline> kids)
Sets the kids of this outlinevoid
setOpen(boolean open)
Setter for property open.void
setStyle(int style)
Setter for property style.void
setTag(String tag)
Setter for property tag.void
setTitle(String title)
Sets the title of this outlinevoid
toPdf(PdfWriter writer, OutputStream os)
Returns the PDF representation of thisPdfOutline
.-
Methods inherited from class com.itextpdf.text.pdf.PdfDictionary
checkType, clear, contains, get, getAsArray, getAsBoolean, getAsDict, getAsIndirectObject, getAsName, getAsNumber, getAsStream, getAsString, getDirectObject, getKeys, isCatalog, isFont, isOutlineTree, isPage, isPages, merge, mergeDifferent, put, putAll, putEx, remove, size, toString
-
Methods inherited from class com.itextpdf.text.pdf.PdfObject
canBeInObjStm, getBytes, getIndRef, isArray, isBoolean, isDictionary, isIndirect, isName, isNull, isNumber, isStream, isString, length, setContent, setIndRef, type
-
-
-
-
Field Detail
-
kids
protected ArrayList<PdfOutline> kids
-
writer
protected PdfWriter writer
-
-
Constructor Detail
-
PdfOutline
public PdfOutline(PdfOutline parent, PdfAction action, String title)
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
public PdfOutline(PdfOutline parent, PdfAction action, String title, boolean open)
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
public PdfOutline(PdfOutline parent, PdfDestination destination, 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, 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
-true
if 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
- thePdfAction
for 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
- thePdfAction
for this outline itemtitle
- the title of this outline itemopen
-true
if 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
-true
if 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
- thePdfAction
for 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
- thePdfAction
for this outline itemtitle
- the title of this outline itemopen
-true
if 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
-true
if the children are visible
-
-
Method Detail
-
setIndirectReference
public void setIndirectReference(PdfIndirectReference reference)
Sets the indirect reference of thisPdfOutline
.- Parameters:
reference
- thePdfIndirectReference
to this outline.
-
indirectReference
public PdfIndirectReference indirectReference()
Gets the indirect reference of thisPdfOutline
.- Returns:
- the
PdfIndirectReference
to this outline.
-
parent
public PdfOutline parent()
Gets the parent of thisPdfOutline
.- Returns:
- the
PdfOutline
that 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:
true
if this page was set as thePdfDestination
-page.
-
getPdfDestination
public PdfDestination getPdfDestination()
Gets the destination for this outline.- Returns:
- the destination
-
level
public int level()
returns the level of this outline.- Returns:
- a level
-
toPdf
public void toPdf(PdfWriter writer, OutputStream os) throws IOException
Returns the PDF representation of thisPdfOutline
.- Overrides:
toPdf
in classPdfDictionary
- Parameters:
writer
- the PdfWriteros
-- Throws:
IOException
-
addKid
public void addKid(PdfOutline outline)
Adds a kid to the outline- Parameters:
outline
-
-
getKids
public ArrayList<PdfOutline> getKids()
Returns the kids of this outline- Returns:
- an ArrayList with PdfOutlines
-
setKids
public void setKids(ArrayList<PdfOutline> kids)
Sets the kids of this outline- Parameters:
kids
-
-
getTag
public String getTag()
Getter for property tag.- Returns:
- Value of property tag.
-
setTag
public void setTag(String tag)
Setter for property tag.- Parameters:
tag
- New value of property tag.
-
getTitle
public String getTitle()
Gets the title of this outline- Returns:
- the title as a String
-
setTitle
public void setTitle(String title)
Sets the title of this outline- Parameters:
title
-
-
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 BaseColor getColor()
Getter for property color.- Returns:
- Value of property color.
-
setColor
public void setColor(BaseColor 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.
-
-