java.lang.Objectcom.aspose.words.DocumentSplitCriteria
public class DocumentSplitCriteria
Different criteria can partially overlap. For instance, Heading 1 style is frequently given
Example:
// Open an existing document from disk
Document doc = new Document(getMyDir() + "Rendering.docx");
// Create a new instance of HtmlSaveOptions. This object allows us to set options that control
// how the output document is saved
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
// Specify the desired encoding
saveOptions.setEncoding(Charset.forName("UTF-8"));
// Specify at what elements to split the internal HTML at. This creates a new HTML within the EPUB
// which allows you to limit the size of each HTML part. This is useful for readers which cannot read
// HTML files greater than a certain size e.g 300kb
saveOptions.setDocumentSplitCriteria(DocumentSplitCriteria.HEADING_PARAGRAPH);
// Specify that we want to export document properties
saveOptions.setExportDocumentProperties(true);
// Specify that we want to save in EPUB format
saveOptions.setSaveFormat(SaveFormat.EPUB);
// Export the document as an EPUB file
doc.save(getArtifactsDir() + "Document.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 |
Field Detail |
---|
NONE = 0 | |
public static final int NONE |
PAGE_BREAK = 1 | |
public static final int PAGE_BREAK |
true
.
COLUMN_BREAK = 2 | |
public static final int COLUMN_BREAK |
SECTION_BREAK = 4 | |
public static final int SECTION_BREAK |
HEADING_PARAGRAPH = 8 | |
public static final int HEADING_PARAGRAPH |