Package com.evopdf

# Class TableOfContentsOptions

java.lang.Object
com.evopdf.TableOfContentsOptions

Direct Known Subclasses:
  `PdfDocumentTableOfContents`

public class TableOfContentsOptions extends Object
This class contains the necessary properties to control the automatic creation of a table of contents in a PDF document

- ## Method Summary

  Modifier and Type
  Method
  Description
  `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
  `RgbColor`
  `backColor()`
  Gets the background color of the PDF pages on which the table of contents is created
  `String`
  `globalStyle()`
  Gets the global CSS style of the table of contents
  `int`
  `maxTocItemTitleLength()`
  Gets the maximum accepted length of the table of contents item title
  `int`
  `pageCount()`
  Gets the number of pages on which the table of contents is created and together with the `startPageIndex()` helps to localize the position of the table of contents inside the generated PDF document.
  `int`
  `pageNumberingStartIndex()`
  Gets the start index for page numbering in the table of contents
  `boolean`
  `pageNumbersEnabled()`
  Gets the flag indicating if the table of contents items will have page numbers besides the title
  `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.
  `void`
  `setBackColor(RgbColor backColor)`
  Sets the background color of the PDF pages on which the table of contents is created
  `void`
  `setGlobalStyle(String globalStyle)`
  Sets the global CSS style of the table of contents.
  `void`
  `setItemStyle(int level, String style)`
  Sets the style of a table of contents item on a given level.
  `void`
  `setMaxTocItemTitleLength(int maxTocItemTitleLength)`
  Sets the maximum accepted length of the table of contents item title.
  `void`
  `setPageNumberingStartIndex(int pageNumberingStartIndex)`
  Sets the start index for page numbering in the table of contents.
  `void`
  `setPageNumbersEnabled(boolean pageNumbersEnabled)`
  Sets the flag indicating if the table of contents items will have page numbers besides the title.
  `void`
  `setPageNumberStyle(int level, String style)`
  Sets the style of the page page numbers on a given level in the table of contents.
  `void`
  `setShowFooter(boolean showFooter)`
  Sets the flag indicating if the document footer is displayed on the table of content pages or not
  `void`
  `setShowHeader(boolean showHeader)`
  Sets the flag indicating if the document header is displayed on the table of content pages or not
  `void`
  `setStartPageNumbersAfterTOC(boolean startPageNumbersAfterTOC)`
  Sets flag indicating if the page numbers start after the table of contents.
  `void`
  `setTitle(String title)`
  Sets the table of contents title
  `void`
  `setTitleStyle(String titleStyle)`
  Sets the global CSS style of the table of contents title.
  `void`
  `setWidth(int width)`
  Sets the table of contents width in pixels.
  `boolean`
  `showFooter()`
  Gets the flag indicating if the document footer is displayed on the table of content pages or not
  `boolean`
  `showHeader()`
  Gets the flag indicating if the document header is displayed on the table of content pages or not
  `int`
  `startPageIndex()`
  Gets the index in PDF document of the page where the table of contents starts.
  `boolean`
  `startPageNumbersAfterTOC()`
  Gets the flag indicating if the page numbers start after the table of contents
  `String`
  `title()`
  Gets the the table of contents title
  `String`
  `titleStyle()`
  Gets the global CSS style of the table of contents title
  `int`
  `width()`
  Gets the table of contents width in pixels

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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

    public String title()
    Gets the the table of contents title
    Returns:
      the table of contents title

  - ### setTitle

    public void setTitle(String title)
    Sets the table of contents title
    Parameters:
      `title` - the table of contents title

  - ### titleStyle

    public String titleStyle()
    Gets the global CSS style of the table of contents title
    Returns:
      the global CSS style of the table of contents title

  - ### setTitleStyle

    public void setTitleStyle(String titleStyle)
    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

    public String globalStyle()
    Gets the global CSS style of the table of contents
    Returns:
      the global CSS style of the table of contents

  - ### setGlobalStyle

    public void setGlobalStyle(String globalStyle)
    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

    public void setItemStyle(int level, String style)
    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 contents
      `style` - the item CSS style

  - ### setPageNumberStyle

    public void setPageNumberStyle(int level, String style)
    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 contents
      `style` - 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

  - ### showFooter

    public boolean showFooter()
    Gets the flag indicating if the document footer is displayed on the table of content pages or not
    Returns:
      the flag value

  - ### setShowFooter

    public void setShowFooter(boolean showFooter)
    Sets the flag indicating if the document footer is displayed on the table of content pages or not
    Parameters:
      `showFooter` - 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 the `Template.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 the `startPageIndex()` 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

    public RgbColor 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

    public void setBackColor(RgbColor backColor)
    Sets the background color of the PDF pages on which the table of contents is created
    Parameters:
      `backColor` - the back color to set