Package com.evopdf
Class TableOfContentsOptions
java.lang.Object
com.evopdf.TableOfContentsOptions
- Direct Known Subclasses:
PdfDocumentTableOfContents
This class contains the necessary properties to control the automatic
creation of a table of contents in a PDF document
-
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the flag indicating if the automatic creation of a table of contents items for the H1 to H6 HTML elements is enabled or notGets the background color of the PDF pages on which the table of contents is createdGets the global CSS style of the table of contentsintGets the maximum accepted length of the table of contents item titleintGets the number of pages on which the table of contents is created and together with thestartPageIndex()helps to localize the position of the table of contents inside the generated PDF document.intGets the start index for page numbering in the table of contentsbooleanGets the flag indicating if the table of contents items will have page numbers besides the titlevoidsetAutoTocItemsEnabled(boolean autoTocItemsEnabled) Sets the flag indicating if the automatic creation of a table of contents items for the H1 to H6 HTML elements is enabled or not.voidsetBackColor(RgbColor backColor) Sets the background color of the PDF pages on which the table of contents is createdvoidsetGlobalStyle(String globalStyle) Sets the global CSS style of the table of contents.voidsetItemStyle(int level, String style) Sets the style of a table of contents item on a given level.voidsetMaxTocItemTitleLength(int maxTocItemTitleLength) Sets the maximum accepted length of the table of contents item title.voidsetPageNumberingStartIndex(int pageNumberingStartIndex) Sets the start index for page numbering in the table of contents.voidsetPageNumbersEnabled(boolean pageNumbersEnabled) Sets the flag indicating if the table of contents items will have page numbers besides the title.voidsetPageNumberStyle(int level, String style) Sets the style of the page page numbers on a given level in the table of contents.voidsetShowFooter(boolean showFooter) Sets the flag indicating if the document footer is displayed on the table of content pages or notvoidsetShowHeader(boolean showHeader) Sets the flag indicating if the document header is displayed on the table of content pages or notvoidsetStartPageNumbersAfterTOC(boolean startPageNumbersAfterTOC) Sets flag indicating if the page numbers start after the table of contents.voidSets the table of contents titlevoidsetTitleStyle(String titleStyle) Sets the global CSS style of the table of contents title.voidsetWidth(int width) Sets the table of contents width in pixels.booleanGets the flag indicating if the document footer is displayed on the table of content pages or notbooleanGets the flag indicating if the document header is displayed on the table of content pages or notintGets the index in PDF document of the page where the table of contents starts.booleanGets the flag indicating if the page numbers start after the table of contentstitle()Gets the the table of contents titleGets the global CSS style of the table of contents titleintwidth()Gets the table of contents width in pixels
-
Method Details
-
autoTocItemsEnabled
public boolean autoTocItemsEnabled()Gets the flag indicating if the automatic creation of a table of contents items for the H1 to H6 HTML elements is enabled or not- Returns:
- the flag value
-
setAutoTocItemsEnabled
public void setAutoTocItemsEnabled(boolean autoTocItemsEnabled) Sets the flag indicating if the automatic creation of a table of contents items for the H1 to H6 HTML elements is enabled or not. By default this property is false- Parameters:
autoTocItemsEnabled- the flag value to set
-
maxTocItemTitleLength
public int maxTocItemTitleLength()Gets the maximum accepted length of the table of contents item title- Returns:
- the maximum accepted length of the table of contents item title
-
setMaxTocItemTitleLength
public void setMaxTocItemTitleLength(int maxTocItemTitleLength) Sets the maximum accepted length of the table of contents item title. If a positive value is set for this property the table of contents item title will be truncated if necessary. By default the table of contents item title will not be truncated- Parameters:
maxTocItemTitleLength- the maximum accepted length of the table of contents item title
-
pageNumbersEnabled
public boolean pageNumbersEnabled()Gets the flag indicating if the table of contents items will have page numbers besides the title- Returns:
- the flag value
-
setPageNumbersEnabled
public void setPageNumbersEnabled(boolean pageNumbersEnabled) Sets the flag indicating if the table of contents items will have page numbers besides the title. By default this property is true- Parameters:
pageNumbersEnabled- the flag value to set
-
title
Gets the the table of contents title- Returns:
- the table of contents title
-
setTitle
Sets the table of contents title- Parameters:
title- the table of contents title
-
titleStyle
Gets the global CSS style of the table of contents title- Returns:
- the global CSS style of the table of contents title
-
setTitleStyle
Sets the global CSS style of the table of contents title. When this property is set with a value, the default style of the title is replaced with the style given by this property. For example, setting a "font-family: 'Times New Roman'; font-size:30px; font-weight:bold; color:red" style will make the converter to use the 'Times New Roman' bold font of 30 pixels and the blue color to write the table of contents title- Parameters:
titleStyle- the global CSS style of the table of contents title
-
globalStyle
Gets the global CSS style of the table of contents- Returns:
- the global CSS style of the table of contents
-
setGlobalStyle
Sets the global CSS style of the table of contents. For example, setting a "body{background-color:blue}" will set a blue color for the table of contents background- Parameters:
globalStyle- the global CSS style of the table of contents
-
setItemStyle
Sets the style of a table of contents item on a given level. The item level is a number from 1 to 6- Parameters:
level- the item level in the table of contentsstyle- the item CSS style
-
setPageNumberStyle
Sets the style of the page page numbers on a given level in the table of contents. The page number level is a number from 1 to 6- Parameters:
level- The page number level in the table of contentsstyle- The page number CSS style
-
width
public int width()Gets the table of contents width in pixels- Returns:
- the table of contents width in pixels
-
setWidth
public void setWidth(int width) Sets the table of contents width in pixels. The table can be resized if necessary to fit the PDF page width. If the property is 0 then the converter will automatically set the width of the table of contents- Parameters:
width- the table of contents width in pixels
-
showHeader
public boolean showHeader()Gets the flag indicating if the document header is displayed on the table of content pages or not- Returns:
- the flag value
-
setShowHeader
public void setShowHeader(boolean showHeader) Sets the flag indicating if the document header is displayed on the table of content pages or not- Parameters:
showHeader- the flag value to set
-
startPageNumbersAfterTOC
public boolean startPageNumbersAfterTOC()Gets the flag indicating if the page numbers start after the table of contents- Returns:
- the flag value
-
setStartPageNumbersAfterTOC
public void setStartPageNumbersAfterTOC(boolean startPageNumbersAfterTOC) Sets flag indicating if the page numbers start after the table of contents. This property also changes the page numbering both in document header and footer and in the table of contents- Parameters:
startPageNumbersAfterTOC- the flag value to set
-
pageNumberingStartIndex
public int pageNumberingStartIndex()Gets the start index for page numbering in the table of contents- Returns:
- the start index for page numbering in the table of contents
-
setPageNumberingStartIndex
public void setPageNumberingStartIndex(int pageNumberingStartIndex) Sets the start index for page numbering in the table of contents. This property can be correlated with theTemplate.pageNumberingStartIndex()property of header and footer- Parameters:
pageNumberingStartIndex- the start index for page numbering in the table of contents
-
startPageIndex
public int startPageIndex()Gets the index in PDF document of the page where the table of contents starts. This property is set by converter after the document with table of contents was generated- Returns:
- the index in PDF document of the page where the table of contents starts
-
pageCount
public int pageCount()Gets the number of pages on which the table of contents is created and together with thestartPageIndex()helps to localize the position of the table of contents inside the generated PDF document. This property is set by converter after the document with table of contents was generated- Returns:
- the number of pages on which the table of contents is created
-
backColor
Gets the background color of the PDF pages on which the table of contents is created- Returns:
- the background color of the PDF pages on which the table of contents is created
-
setBackColor
Sets the background color of the PDF pages on which the table of contents is created- Parameters:
backColor- the back color to set
-