This demo uses the DevExpress Spreadsheet Document API to convert Excel worksheets to HTML pages. You can process the sample file or supply your own document. To do the latter, select Upload a File in the file selection drop-down menu.
Specify the worksheet index and check the Export Images box to keep images in the resulting HTML page. Click Convert Document to generate and download the result.
using DevExpress.Spreadsheet;
using DevExpress.XtraSpreadsheet.Export;
Stream ConvertToHtml(Stream inputStream, int sheetIndex, bool exportImages) {
using var workbook = new Workbook();
workbook.LoadDocument(inputStream);
var outputStream = new MemoryStream();
var exportOptions = new HtmlDocumentExporterOptions() {
SheetIndex = sheetIndex,
EmbedImages = true,
ExportImages = exportImages
};
workbook.ExportToHtml(outputStream, exportOptions);
outputStream.Position = 0;
return outputStream;
}