Hi,
Excel files are not converting into .bmp images for attached excel file. I am using the below code snippet.
//initializing Aspose license for Excel Application
AsposeExcel.
License license = new AsposeExcel.License();
license.SetLicense(
"Aspose.Total.lic");
//initializing Aspose Excel Workbook object with the provided excel template.
AsposeExcel.
Workbook workBook = new AsposeExcel.Workbook(sourcePath);
//fetch file name of excel template without extension i.e. asset id
fileName =
Path.GetFileNameWithoutExtension(workBook.FileName);
//define the temporary image format.
imageFileExtension =
".bmp";
//finding the orientation of first sheet in the excel file as per VNext specification
orientation = workBook.Worksheets[0].PageSetup.Orientation.ToString();
//initializing image saving options and defining the image format.
Aspose.Cells.Rendering.
ImageOrPrintOptions options = new Aspose.Cells.Rendering.ImageOrPrintOptions();
options.ImageFormat = System.Drawing.Imaging.
ImageFormat.Bmp;
options.OnePagePerSheet =
false;
//initializing sheet render object with first sheet in the workbook
Aspose.Cells.Rendering.
SheetRender renderImage = new Aspose.Cells.Rendering.SheetRender(workBook.Worksheets[0], options);
//looping through all the pages in the first sheet.
for (int i = 0; i < renderImage.PageCount; i++)
{
renderImage.PageCount = 1;
//creating the temporary bmp file in the temp folder
renderImage.ToImage(i, tempFolderPath +
@"\" + fileName + "_Bmp" + ++imgCounter + imageFileExtension);
}