Class TocWriter

java.lang.Object
io.goobi.viewer.model.toc.export.pdf.TocWriter

public class TocWriter extends Object
Writes a table-of-contents structure to a PDF document.
  • Constructor Details

    • TocWriter

      public TocWriter(String author, String title)
      Creates a new TocWriter instance.
      Parameters:
      author - author name added to the PDF document metadata
      title - title displayed as heading and added to PDF metadata
  • Method Details

    • getAuthor

      public String getAuthor()
      Getter for the field author.
      Returns:
      the author of the document represented in this TOC entry
    • getTitle

      public String getTitle()
      Getter for the field title.
      Returns:
      the title of the document represented in this TOC entry
    • getLevelIndent

      public int getLevelIndent()
      Getter for the field levelIndent.
      Returns:
      a int.
    • setLevelIndent

      public void setLevelIndent(int levelIndent)
      Setter for the field levelIndent.
      Parameters:
      levelIndent - pixel indentation applied per hierarchy level
    • createPdfDocument

      public void createPdfDocument(OutputStream output, List<TOCElement> elements) throws WriteTocException
      createDocument.
      Parameters:
      output - stream to write the generated PDF document to
      elements - TOC elements to render as PDF table rows
      Throws:
      WriteTocException - if any.
    • getAsText

      public String getAsText(List<TOCElement> elements)
      Parameters:
      elements - TOC element list
      Returns:
      String
    • main

      public static void main(String[] args) throws IOException, WriteTocException
      main.
      Parameters:
      args - command-line arguments (unused)
      Throws:
      FileNotFoundException - if any.
      IOException - if any.
      WriteTocException - if any.