public void SaveHtmlWithOptions()
{
//ExStart
//ExFor:HtmlSaveOptions
//ExFor:HtmlSaveOptions.ExportTextInputFormFieldAsText
//ExFor:HtmlSaveOptions.ImagesFolder
//ExId:SaveWithOptions
//ExSummary:Shows how to set save options before saving a document to HTML.
Document doc = new Document(MyDir + "Rendering.doc");
// This is the directory we want the exported images to be saved to.
string imagesDir = Path.Combine(MyDir, "Images");
// The folder specified needs to exist and should be empty.
if (Directory.Exists(imagesDir))
Directory.Delete(imagesDir, true);
Directory.CreateDirectory(imagesDir);
// Set an option to export form fields as plain text, not as HTML input elements.
HtmlSaveOptions options = new HtmlSaveOptions(SaveFormat.Html);
options.ExportTextInputFormFieldAsText = true;
options.ImagesFolder = imagesDir;
doc.Save(MyDir + @"\Artifacts\Document.SaveWithOptions.html", options);
//ExEnd
// Verify the images were saved to the correct location.
Assert.IsTrue(File.Exists(MyDir + @"\Artifacts\Document.SaveWithOptions.html"));
Assert.AreEqual(9, Directory.GetFiles(imagesDir).Length);
}