public class TocGenerator extends Object
Constructor and Description |
---|
TocGenerator(WordprocessingMLPackage wordMLPackage) |
Modifier and Type | Method and Description |
---|---|
SdtBlock |
generateToc(boolean skipPageNumbering)
Generate Table of Contents using default TOC instruction, adding it at the beginning of the document
To alter the ToC heading, use Toc.setTocHeadingText
|
SdtBlock |
generateToc(int index,
String instruction,
boolean skipPageNumbering)
Generate Table of Contents using provided TOC instruction, adding at the given index in the body of document,
using dot leader for page numbering (if any).
|
SdtBlock |
generateToc(int index,
String instruction,
STTabTlc leader,
boolean skipPageNumbering)
Generate Table of Contents using provided TOC instruction, and specified leader (eg dots) before
page number, adding at the given index in the body of document
It is an error if a ToC content control is already present; delete it or use updateToc.
|
protected SdtBlock |
generateToc(SdtBlock sdt,
List<P> tocHeadingP,
String instruction,
STTabTlc leader,
boolean skipPageNumbering)
Generate Table of Contents in the given sdt with provided tocHeadingP, and given TOC instruction.
|
protected SdtBlock |
generateToc(SdtBlock sdt,
String instruction,
STTabTlc leader,
boolean skipPageNumbering)
Generate Table of Contents in the given sdt with generated heading, and given TOC instruction.
|
static SdtBlock |
generateToc(WordprocessingMLPackage wordMLPackage,
boolean skipPageNumbering)
Deprecated.
|
static SdtBlock |
generateToc(WordprocessingMLPackage wordMLPackage,
int index,
String instruction,
boolean skipPageNumbering)
Deprecated.
|
WordprocessingMLPackage |
getWordMLPackage() |
void |
pageNumbersViaXSLT(boolean useXSLT)
Whether to use XSLT to generate page numbers in the TOC via FOP.
|
void |
setStartingIdForNewBookmarks(AtomicInteger bookmarkId)
Provide a way to set the starting bookmark ID number.
|
SdtBlock |
updateToc(boolean skipPageNumbering)
Update existing TOC in the document with TOC generated by generateToc() method, reusing the existing ToC heading paragraph.
|
SdtBlock |
updateToc(boolean skipPageNumbering,
boolean reuseExistingToCHeadingP)
Update existing TOC in the document with TOC generated by generateToc() method.
|
SdtBlock |
updateToc(boolean skipPageNumbering,
boolean reuseExistingToCHeadingP,
STTabTlc leader)
Update existing TOC in the document with TOC generated by generateToc() method, using specified tab leader.
|
static SdtBlock |
updateToc(WordprocessingMLPackage wordMLPackage,
boolean skipPageNumbering)
Deprecated.
|
SdtBlock |
updateToc(WordprocessingMLPackage wordMLPackage,
boolean skipPageNumbering,
boolean reuseExistingToCHeadingP)
Deprecated.
|
public TocGenerator(WordprocessingMLPackage wordMLPackage) throws TocException
TocException
public WordprocessingMLPackage getWordMLPackage()
@Deprecated public static SdtBlock generateToc(WordprocessingMLPackage wordMLPackage, boolean skipPageNumbering) throws TocException
body
- of documentskipPageNumbering
- don't generate page numbers (useful for HTML output, or speed, or as a fallback in case of issues)TocException
@Deprecated public static SdtBlock generateToc(WordprocessingMLPackage wordMLPackage, int index, String instruction, boolean skipPageNumbering) throws TocException
body
- index
- instruction
- TocException
public SdtBlock generateToc(boolean skipPageNumbering) throws TocException
body
- of documentskipPageNumbering
- don't generate page numbers (useful for HTML output, or speed, or as a fallback in case of issues)TocException
public SdtBlock generateToc(int index, String instruction, boolean skipPageNumbering) throws TocException
index
- instruction
- skipPageNumbering
- TocException
public SdtBlock generateToc(int index, String instruction, STTabTlc leader, boolean skipPageNumbering) throws TocException
index
- instruction
- leader
- skipPageNumbering
- TocException
protected SdtBlock generateToc(SdtBlock sdt, String instruction, STTabTlc leader, boolean skipPageNumbering) throws TocException
body
- sdt
- - assumed already attached to the documentinstruction
- skipPageNumbering
- don't generate page numbers (useful for HTML output, or speed, or as a fallback in case of issues)TocException
protected SdtBlock generateToc(SdtBlock sdt, List<P> tocHeadingP, String instruction, STTabTlc leader, boolean skipPageNumbering) throws TocException
body
- sdt
- tocHeadingP
- use this P as the ToC headinginstruction
- skipPageNumbering
- don't generate page numbers (useful for HTML output, or speed, or as a fallback in case of issues)TocException
public void setStartingIdForNewBookmarks(AtomicInteger bookmarkId)
bookmarkId
- public SdtBlock updateToc(boolean skipPageNumbering) throws TocException
body
- skipPageNumbering
- don't generate page numbers (useful for HTML output, or speed, or as a fallback in case of issues)TocException
@Deprecated public static SdtBlock updateToc(WordprocessingMLPackage wordMLPackage, boolean skipPageNumbering) throws TocException
TocException
public SdtBlock updateToc(boolean skipPageNumbering, boolean reuseExistingToCHeadingP) throws TocException
body
- skipPageNumbering
- don't generate page numbers (useful for HTML output, or speed, or as a fallback in case of issues)reuseExistingToCHeadingP
- TocException
public SdtBlock updateToc(boolean skipPageNumbering, boolean reuseExistingToCHeadingP, STTabTlc leader) throws TocException
body
- skipPageNumbering
- don't generate page numbers (useful for HTML output, or speed, or as a fallback in case of issues)reuseExistingToCHeadingP
- leader
- TocException
@Deprecated public SdtBlock updateToc(WordprocessingMLPackage wordMLPackage, boolean skipPageNumbering, boolean reuseExistingToCHeadingP) throws TocException
body
- skipPageNumbering
- don't generate page numbers (useful for HTML output, or speed, or as a fallback in case of issues)reuseExistingToCHeadingP
- TocException
public void pageNumbersViaXSLT(boolean useXSLT)
useXSLT
- Copyright © 2007-2017. All Rights Reserved.