Class TocWriter
java.lang.Object
io.goobi.viewer.model.toc.export.pdf.TocWriter
Writes a table-of-contents structure to a PDF document.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcreatePdfDocument(OutputStream output, List<TOCElement> elements) createDocument.getAsText(List<TOCElement> elements) Getter for the fieldauthor.intGetter for the fieldlevelIndent.getTitle()Getter for the fieldtitle.static voidmain.voidsetLevelIndent(int levelIndent) Setter for the fieldlevelIndent.
-
Constructor Details
-
TocWriter
Creates a new TocWriter instance.- Parameters:
author- author name added to the PDF document metadatatitle- title displayed as heading and added to PDF metadata
-
-
Method Details
-
getAuthor
Getter for the fieldauthor.- Returns:
- the author of the document represented in this TOC entry
-
getTitle
Getter for the fieldtitle.- Returns:
- the title of the document represented in this TOC entry
-
getLevelIndent
public int getLevelIndent()Getter for the fieldlevelIndent.- Returns:
- a int.
-
setLevelIndent
public void setLevelIndent(int levelIndent) Setter for the fieldlevelIndent.- 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 toelements- TOC elements to render as PDF table rows- Throws:
WriteTocException- if any.
-
getAsText
- Parameters:
elements- TOC element list- Returns:
String
-
main
main.- Parameters:
args- command-line arguments (unused)- Throws:
FileNotFoundException- if any.IOException- if any.WriteTocException- if any.
-