HtmlSaveOptionsDocumentSplitCriteria Property

Specifies how the document should be split when saving to Html or Epub format. Default is None for HTML and HeadingParagraph for EPUB.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntax
public DocumentSplitCriteria DocumentSplitCriteria { get; set; }

Property Value

Type: DocumentSplitCriteria
Remarks

Normally you would want a document saved to HTML as a single file. But in some cases it is preferable to split the output into several smaller HTML pages. When saving to HTML format these pages will be output to individual files or streams. When saving to EPUB format they will be incorporated into corresponding packages.

A document cannot be split when saving in the MHTML format.

Examples
Converts a document to EPUB with save options specified.
// Open an existing document from disk
Document doc = new Document(MyDir + "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.Encoding = Encoding.UTF8;

// 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.DocumentSplitCriteria = DocumentSplitCriteria.HeadingParagraph;

// Specify that we want to export document properties
saveOptions.ExportDocumentProperties = true;

// Specify that we want to save in EPUB format
saveOptions.SaveFormat = SaveFormat.Epub;

// Export the document as an EPUB file
doc.Save(ArtifactsDir + "Document.Doc2EpubSaveOptions.epub", saveOptions);
See Also