I’m converting an Excel file to HTML which consists of a chart sheet and a data sheet (see attached file), and the resulting HTML is written to the Response
of a .NET aspx web form
var handler = new ViewerHtmlHandler();
using (var stream = new MemoryStream())
{
// the document is downloaded from Azure Blob Storage
await cloudBlockBlob.DownloadToStreamAsync(stream);
stream.Position = 0;
var page = 1;
var pagesToRender = new List<int>() { 1 };
var options = new HtmlOptions()
{
EmbedResources = true,
PageNumber = page,
PageNumbersToRender = pagesToRender
};
var pages = handler.GetPages(stream, options);
var firstPage = pages.First();
Response.Write(firstPage.HtmlContent);
}
Response.End();
This works, except that the chart slide is converted to an image and the <img>
tag’s src
attribute points to a location on the server’s temp directory, which is not served by the web server.
<img src="D:\local\Temp\ChartMilk_Utilisation.jpg" alt="1">
How do I configure this to include the image correctly? I was hoping that they would be converted to data urls. I’ve tried all possible combinations of properties in populating the HtmlOptions
instance.
Thanks for your help!
milkutil_dataset_13aug15.csv.xlsx.zip (67.2 KB)