Hi,
We are using Aspose.Cells.dll (4.8.2.15) to convert xls files to tif images.
Following code throws ArgumentException (Parameter is not valid.) with attached Excel.xls:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Text;
using Aspose.Cells;
namespace ExcelTester
{
class Program
{
static void Main(string[] args)
{
Aspose.Cells.License licenseCells = new Aspose.Cells.License();
licenseCells.SetLicense("Aspose.Cells.lic");
Workbook book = new Workbook();
book.Open("Excel.xls");
ImageOrPrintOptions imgOptions = new ImageOrPrintOptions();
imgOptions.ImageFormat = ImageFormat.Tiff;
imgOptions.HorizontalResolution = 200;
imgOptions.VerticalResolution = 200;
imgOptions.TiffCompression = TiffCompression.CompressionCCITT4;
imgOptions.PrintingPage = PrintingPageType.IgnoreBlank;
for (int i = 0; i < book.Worksheets.Count; i++)
{
Worksheet sheet = book.Worksheets[i];
foreach (Cell cell in sheet.Cells)
{
cell.Style.Font.Color = Color.Empty;
cell.Style.ForegroundColor = Color.Empty;
cell.Style.BackgroundColor = Color.Empty;
cell.Style.Pattern = BackgroundType.None;
}
int sheetPageCount = sheet.GetPageCount(imgOptions.PrintingPage);
for (int j = 0; j < sheetPageCount; j++)
sheet.SheetToImageByPage(j, "image" + i.ToString() + "_" + j.ToString() + ".tif", imgOptions); // Exception Here!
}
}
}
}
Please test above code with attached Excel.xls file with Aspose.Cells.dll (4.8.2.15).
This issue was reported from our customer as critical issue that must be fixed ASAP.
It is being used in live production environment and fix is urgent.
Please provide us with an ETA for a fix so that we can tell our customer.
Thank You.