Hi,
We are using 'Aspose.Cells.dll' (6.0.0.2) to convert Excel files to Tiff images and we noticed "Format specifier was invalid." exception when 'SheetRender.ToImage()' is being done on attached files.
Here is the sample code we are using:
using System;using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Imaging;
using Aspose.Cells;
using Aspose.Cells.Rendering;
namespace Test
{
class Program
{
static void Main(string[] args)
{
try
{
string fullPath = @"C:\Test\Input.xls";
License lic = new License();
lic.SetLicense("Aspose.Cells.lic");
Workbook book = new Workbook(fullPath);
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)
{
Style s = cell.GetStyle();
s.Font.Color = Color.Empty;
s.ForegroundColor = Color.Empty;
s.BackgroundColor = Color.Empty;
s.Pattern = BackgroundType.None;
cell.SetStyle(s);
}
SheetRender sr = new SheetRender(sheet, imgOptions);
for (int j = 0; j < sr.PageCount; j++)
sr.ToImage(j, @"C:\Test\Output" + (i + 1).ToString().PadLeft(3, '0') + (j + 1).ToString().PadLeft(3, '0') + ".tif"); // Exception Here!
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.Read();
}
}
}
}
Please review them and let us know when fix can be available.
This is critical customer request in which we need to provide fix ASAP.
Thanks!