public class DocumentSplitCriteria
Different criteria can partially overlap. For instance, Heading 1 style is frequently given
Example:
Document doc = new Document(getMyDir() + "Rendering.docx");
// Use a SaveOptions object to specify the encoding for a document that we will save.
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.setSaveFormat(SaveFormat.EPUB);
saveOptions.setEncoding(StandardCharsets.UTF_8);
// By default, an output .epub document will have all of its contents in one HTML part.
// A split criterion allows us to segment the document into several HTML parts.
// We will set the criteria to split the document into heading paragraphs.
// This is useful for readers who cannot read HTML files more significant than a specific size.
saveOptions.setDocumentSplitCriteria(DocumentSplitCriteria.HEADING_PARAGRAPH);
// Specify that we want to export document properties.
saveOptions.setExportDocumentProperties(true);
doc.save(getArtifactsDir() + "HtmlSaveOptions.Doc2EpubSaveOptions.epub", saveOptions);
Field Summary | ||
---|---|---|
static final int | NONE | |
The document is not split.
|
||
static final int | PAGE_BREAK | |
The document is split into parts at explicit page breaks.
A page break can be specified by a true .
|
||
static final int | COLUMN_BREAK | |
The document is split into parts at column breaks.
A column break can be specified by a |
||
static final int | SECTION_BREAK | |
The document is split into parts at a section break of any type.
|
||
static final int | HEADING_PARAGRAPH | |
The document is split into parts at a paragraph formatted using a heading style Heading 1, Heading 2 etc.
Use together with |
public static final int NONE
public static final int PAGE_BREAK
true
.
public static final int COLUMN_BREAK
public static final int SECTION_BREAK
public static final int HEADING_PARAGRAPH