Package com.evopdf

Class PdfBookmarkOptions

java.lang.Object
com.evopdf.PdfBookmarkOptions

public class PdfBookmarkOptions extends Object
This class contains the necessary properties to control the bookmarks creation in a PDF document
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Gets the flag indicating if the HTML elements without text can be bookmarked
    boolean
    Gets the flag indicating if the automatic creation of bookmarks in PDF for the H1 to H6 HTML elements is enabled or not
    Gets the default title to be used for bookmarks that don't have an associated text
    boolean
    Gets the flag indicating if the bookmarks created in PDF for the HTML elements are arranged in a hierarchy based on the bookmark levels defined in HTML
    Gets the array containing the selectors of the HTML elements to be bookmarked
    int
    Gets the maximum accepted length of the bookmark title string.
    void
    setAllowDefaultTitle(boolean allowDefaultTitle)
    Sets the flag indicating if the HTML elements without text can be bookmarked.
    void
    setAutoBookmarksEnabled(boolean autoBookmarksEnabled)
    Sets the flag indicating if the automatic creation of bookmarks in PDF for the H1 to H6 HTML elements is enabled or not.
    void
    setDefaultTitle(String defaultTitle)
    Sets the default title to be used for bookmarks that don't have an associated text.
    void
    setHierarchicalBookmarks(boolean hierarchicalBookmarks)
    Sets the flag indicating if the bookmarks created in PDF for the HTML elements are arranged in a hierarchy based on the bookmark levels defined in HTML.
    void
    Sets an array containing the selectors of the HTML elements to be bookmarked.
    void
    setMaxTitleLength(int maxTitleLength)
    Sets the maximum accepted length of the bookmark title string.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • PdfBookmarkOptions

      public PdfBookmarkOptions()
  • Method Details

    • autoBookmarksEnabled

      public boolean autoBookmarksEnabled()
      Gets the flag indicating if the automatic creation of bookmarks in PDF for the H1 to H6 HTML elements is enabled or not
      Returns:
      the flag value
    • setAutoBookmarksEnabled

      public void setAutoBookmarksEnabled(boolean autoBookmarksEnabled)
      Sets the flag indicating if the automatic creation of bookmarks in PDF for the H1 to H6 HTML elements is enabled or not. By default the automatic bookmarks creation is disabled
      Parameters:
      autoBookmarksEnabled - the flag value to set
    • hierarchicalBookmarks

      public boolean hierarchicalBookmarks()
      Gets the flag indicating if the bookmarks created in PDF for the HTML elements are arranged in a hierarchy based on the bookmark levels defined in HTML
      Returns:
      the flag value
    • setHierarchicalBookmarks

      public void setHierarchicalBookmarks(boolean hierarchicalBookmarks)
      Sets the flag indicating if the bookmarks created in PDF for the HTML elements are arranged in a hierarchy based on the bookmark levels defined in HTML. By default this property is true
      Parameters:
      hierarchicalBookmarks - the flag value to set
    • htmlElementSelectors

      public String[] htmlElementSelectors()
      Gets the array containing the selectors of the HTML elements to be bookmarked
      Returns:
      the array containing the selectors of the HTML elements to be bookmarked
    • setHtmlElementSelectors

      public void setHtmlElementSelectors(String[] selectors)
      Sets an array containing the selectors of the HTML elements to be bookmarked. For example, the selector for all the image elements is "img", the selector for all the elements with the CSS class name 'myclass' is "*.myclass" and the selector for the elements with the id 'myid' is "*#myid"
      Parameters:
      selectors - the selectors to set
    • allowDefaultTitle

      public boolean allowDefaultTitle()
      Gets the flag indicating if the HTML elements without text can be bookmarked
      Returns:
      the flag value
    • setAllowDefaultTitle

      public void setAllowDefaultTitle(boolean allowDefaultTitle)
      Sets the flag indicating if the HTML elements without text can be bookmarked. This property is true by default
      Parameters:
      allowDefaultTitle - the flag value to set
    • defaultTitle

      public String defaultTitle()
      Gets the default title to be used for bookmarks that don't have an associated text
      Returns:
      the default title to be used for bookmarks that don't have an associated text
    • setDefaultTitle

      public void setDefaultTitle(String defaultTitle)
      Sets the default title to be used for bookmarks that don't have an associated text. This property has effect only if allowDefaultTitle() is true. This property defaults to "Bookmark" text
      Parameters:
      defaultTitle - the default title to be used for bookmarks that don't have an associated text
    • maxTitleLength

      public int maxTitleLength()
      Gets the maximum accepted length of the bookmark title string. If a positive value is set for this property the bookmark title will be truncated if necessary
      Returns:
      the maximum accepted length of the bookmark title string
    • setMaxTitleLength

      public void setMaxTitleLength(int maxTitleLength)
      Sets the maximum accepted length of the bookmark title string. If a positive value is set for this property the bookmark title will be truncated if necessary.By default and the bookmark title will not be truncated
      Parameters:
      maxTitleLength - the maximum accepted length of the bookmark title string to set