Free Support Forum - aspose.com

Execl to png with multiple sheets (C#)

A EXECL with multiple sheets, how are converted into png

Hi,


See the sample code below:

Sample code:

int idx = 0;
Workbook workbook = new Workbook(path);


foreach (Worksheet worksheet in workbook.Worksheets)
{

ImageOrPrintOptions opts = new ImageOrPrintOptions();

opts.OnePagePerSheet = true;


SheetRender sr = new SheetRender(worksheet, opts);

Bitmap bmp = sr.ToImage(0);


bmp.Save(path + idx + “.out.png”, ImageFormat.Png);
idx++;

}

Thank you.