Hi,
I am getting same issue in latest version of aspose.cells.dll for .net version 7.1.0.4. please find the below sample code to reproduce the issue. The output tiff file contains the hidden column also, but i don't want to print the hidden column. I have attached the source file and output tiff file. The column "B" is hidden, but in output tiff file the B column is visible.
private void button1_Click(object sender, EventArgs e)
{
string fileName = @"C:\Documents and Settings\RangarDX\Desktop\Test data.xlsx";
Workbook wb = new Workbook(fileName);
// Create and add cell wrap style
Style style = wb.Styles[wb.Styles.Add()];
style.IsTextWrapped = true;
// Create and set style flag
StyleFlag styleFlag = new StyleFlag();
styleFlag.WrapText = true;
foreach (Worksheet ws in wb.Worksheets)
{
ws.AutoFitColumns();
if (ws.Cells.Count == 0)
continue;}
ImageOrPrintOptions _printOptions = CreateSaveOptions();
WorkbookRender bookRender = new WorkbookRender(wb, _printOptions);
bookRender.ToImage(@"C:\testOutput.tif");}
private new ImageOrPrintOptions CreateSaveOptions()
{
ImageOrPrintOptions tiffOptions = new ImageOrPrintOptions();
tiffOptions.HorizontalResolution = 300;
tiffOptions.VerticalResolution = 300;
tiffOptions.PrintingPage = PrintingPageType.Default;
tiffOptions.PrintWithStatusDialog = false;
tiffOptions.ImageFormat = System.Drawing.Imaging.ImageFormat.Tiff;
tiffOptions.TiffCompression = Aspose.Cells.Rendering.TiffCompression.CompressionNone;
tiffOptions.IsCellAutoFit = true;
tiffOptions.IsImageFitToPage = true;
return tiffOptions;
}