Package com.itextpdf.kernel.pdf
Class PdfOutline
java.lang.Object
com.itextpdf.kernel.pdf.PdfOutline
Document outline object See ISO-320001, 12.3.3 Document Outline.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
A flag for displaying the outline item’s text with bold font.static final int
A flag for displaying the outline item’s text with italic font. -
Method Summary
Modifier and TypeMethodDescriptionvoid
AddsPdfAction
for the outline,A
key.void
addDestination
(PdfDestination destination) AddsPdfDestination
for the outline,Dest
key.addOutline
(PdfOutline outline) Adds anPdfOutline
as a child to existingPdfOutline
and put it to the end of the existingPdfOutline
children list.addOutline
(String title) Adds anPdfOutline
as a child to existingPdfOutline
and put it in the end of the existingPdfOutline
children list.addOutline
(String title, int position) Adds a newPdfOutline
with specified parameters as a child to existingPdfOutline
and put it to specified position in the existingPdfOutline
children list.Gets list of children outlines.getColor()
Gets color for the outline entry's text,C
key.Gets content dictionary.GetsPdfDestination
.Gets parent outline.getStyle()
Gets text style for the outline entry's text,F
key.getTitle()
Gets title of the outline.boolean
isOpen()
Defines if the outline is open or closed.void
Remove this outline from the document.void
Sets color for the outline entry’s text,C
key.void
setOpen
(boolean open) Defines if the outline needs to be closed or not.void
setStyle
(int style) Sets text style for the outline entry’s text,F
key.void
Sets title of the outline withPdfEncodings.UNICODE_BIG
encoding,Title
key.
-
Field Details
-
FLAG_ITALIC
public static final int FLAG_ITALICA flag for displaying the outline item’s text with italic font.- See Also:
-
FLAG_BOLD
public static final int FLAG_BOLDA flag for displaying the outline item’s text with bold font.- See Also:
-
-
Method Details
-
getTitle
Gets title of the outline.- Returns:
- String value.
-
setTitle
Sets title of the outline withPdfEncodings.UNICODE_BIG
encoding,Title
key.- Parameters:
-
title
- String value.
-
setColor
Sets color for the outline entry’s text,C
key.- Parameters:
-
color
-Color
-
getColor
Gets color for the outline entry's text,C
key.- Returns:
-
color
Color
.
-
setStyle
public void setStyle(int style) Sets text style for the outline entry’s text,F
key.- Parameters:
-
style
- Could be eitherFLAG_BOLD
orFLAG_ITALIC
. Default value is0
.
-
getStyle
Gets text style for the outline entry's text,F
key.- Returns:
- style value.
-
getContent
Gets content dictionary.- Returns:
-
PdfDictionary
.
-
getAllChildren
Gets list of children outlines.- Returns:
-
List of
PdfOutline
.
-
getParent
Gets parent outline.- Returns:
-
PdfOutline
.
-
getDestination
GetsPdfDestination
.- Returns:
-
PdfDestination
.
-
addAction
AddsPdfAction
for the outline,A
key.- Parameters:
-
action
- instance ofPdfAction
.
-
setOpen
public void setOpen(boolean open) Defines if the outline needs to be closed or not. By default, outlines are open.- Parameters:
-
open
- if false, the outline will be closed by default
-
isOpen
public boolean isOpen()Defines if the outline is open or closed.- Returns:
- true if open,false otherwise.
-
addOutline
Adds a newPdfOutline
with specified parameters as a child to existingPdfOutline
and put it to specified position in the existingPdfOutline
children list.- Parameters:
-
title
- an outline title -
position
- a position in the current outline child List where a new outline should be added. If the position equals -1, then the outline will be put in the end of children list. - Returns:
- just created outline
-
addOutline
Adds anPdfOutline
as a child to existingPdfOutline
and put it in the end of the existingPdfOutline
children list.- Parameters:
-
title
- an outline title - Returns:
- just created outline
-
addOutline
Adds anPdfOutline
as a child to existingPdfOutline
and put it to the end of the existingPdfOutline
children list.- Parameters:
-
outline
- an outline to add. - Returns:
- just created outline
-
removeOutline
public void removeOutline()Remove this outline from the document. Outlines that are children of this outline are removed recursively
-