NodeToString Method (SaveOptions)
Exports the content of the node into a string using the specified save options.

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 20.1
public string ToString(
	SaveOptions saveOptions


Type: Aspose.Words.SavingSaveOptions
Specifies the options that control how the node is saved.

Return Value

Type: String
The content of the node in the specified format.
Exports the content of a node to String in HTML format using custom specified options.
Document doc = new Document(MyDir + "Document.doc");

// Extract the last paragraph in the document to convert to HTML
Node node = doc.LastSection.Body.LastParagraph;

// Create an instance of HtmlSaveOptions and set a few options
HtmlSaveOptions saveOptions = new HtmlSaveOptions
    ExportHeadersFootersMode = ExportHeadersFootersMode.PerSection,
    ExportRelativeFontSize = true

// Convert the document to HTML and return as a String. Pass the instance of HtmlSaveOptions to
// to use the specified options during the conversion
string nodeAsHtml = node.ToString(saveOptions);
See Also