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
FieldsModifier and TypeFieldDescriptionstatic final intA flag for displaying the outline item’s text with bold font.static final intA flag for displaying the outline item’s text with italic font. -
Method Summary
Modifier and TypeMethodDescriptionvoidAddsPdfActionfor the outline,Akey.voidaddDestination(PdfDestination destination) AddsPdfDestinationfor the outline,Destkey.addOutline(PdfOutline outline) Adds anPdfOutlineas a child to existingPdfOutlineand put it to the end of the existingPdfOutlinechildren list.addOutline(String title) Adds anPdfOutlineas a child to existingPdfOutlineand put it in the end of the existingPdfOutlinechildren list.addOutline(String title, int position) Adds a newPdfOutlinewith specified parameters as a child to existingPdfOutlineand put it to specified position in the existingPdfOutlinechildren list.Gets list of children outlines.getColor()Gets color for the outline entry's text,Ckey.Gets content dictionary.GetsPdfDestination.Gets parent outline.getStyle()Gets text style for the outline entry's text,Fkey.getTitle()Gets title of the outline.booleanisOpen()Defines if the outline is open or closed.voidRemove this outline from the document.voidSets color for the outline entry’s text,Ckey.voidsetOpen(boolean open) Defines if the outline needs to be closed or not.voidsetStyle(int style) Sets text style for the outline entry’s text,Fkey.voidSets title of the outline withPdfEncodings.UNICODE_BIGencoding,Titlekey.
-
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_BIGencoding,Titlekey.- Parameters:
-
title- String value.
-
setColor
Sets color for the outline entry’s text,Ckey.- Parameters:
-
color-Color
-
getColor
Gets color for the outline entry's text,Ckey.- Returns:
-
color
Color.
-
setStyle
public void setStyle(int style) Sets text style for the outline entry’s text,Fkey.- Parameters:
-
style- Could be eitherFLAG_BOLDorFLAG_ITALIC. Default value is0.
-
getStyle
Gets text style for the outline entry's text,Fkey.- 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
AddsPdfActionfor the outline,Akey.- 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 newPdfOutlinewith specified parameters as a child to existingPdfOutlineand put it to specified position in the existingPdfOutlinechildren 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 anPdfOutlineas a child to existingPdfOutlineand put it in the end of the existingPdfOutlinechildren list.- Parameters:
-
title- an outline title - Returns:
- just created outline
-
addOutline
Adds anPdfOutlineas a child to existingPdfOutlineand put it to the end of the existingPdfOutlinechildren 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
-