Render empty XLSX cells when converting to PNG in .NET

I was wondering if it is somehow possible to render empty spreadsheet cells when creating a PNG.
We are using GroupDocs Viewer to create a thumbnail of the attached XLSX and expected something close to A4 format regarding width to height aspect ratio, but the output is a very long thumbnail.

It also only renders the first cell without overlapping the contained text to the next empty cells, which makes it worse.
For GroupDocs Conversion we are using “SkipEmptyRowsAndColumns = false” in the spreadsheet load options to render empty cells.
Is there something similar or another way to improve the thumbnail generation with the Viewer?
I also attempted to add this to our options, but since empty cells are not rendered, it did not change anything:
SpreadsheetOptions = SpreadsheetOptions.ForSplitSheetIntoPages(60, 40)

Our current options:

    var options = new PngViewOptions(sOutputFile)
    {
        Width = 256,
    };

Long Thumbnail.zip (91.9 KB)

@Clemens_Pestuka

We’re investigating this scenario. Your investigation ticket ID is VIEWERNET-2780. You’ll be notified as there’s any update.

1 Like

@Clemens_Pestuka

Please have a look at this image.png (5.5 KB). All the 15 columns are rendered and the text is overlapping the next cell if it is empty. This is the output from API version 20.10 that is expected to be released soon. We’ll notify you as release gets onboard.

1 Like

@Atir_Tahir
That looks perfect :grinning: thanks a lot!
I’m looking forward to the next API release.

@Clemens_Pestuka

You’re welcome.

1 Like

The issues you have found earlier (filed as VIEWERNET-2780) have been fixed in this update. This message was posted using Bugs notification tool by Atir_Tahir

@Atir_Tahir

Sorry for the late reply, but when I tested with GroupDocs Viewer 20.10.0 the thumbnail still looks the same and not like the screenshot you provided.
Do I have to set some special option or should it work with defaults?

1 Like

@Clemens_Pestuka

Can you please try following code:

using (Viewer viewer = new Viewer("019916.xlsx"))
{
    PngViewOptions viewOptions = new PngViewOptions("thumbnail.png");
    viewOptions.SpreadsheetOptions = SpreadsheetOptions.ForSplitSheetIntoPages(50, 15);
    viewOptions.SpreadsheetOptions.TextOverflowMode = TextOverflowMode.OverlayIfNextEmpty;

    viewer.View(viewOptions, 1);
}
1 Like

@Atir_Tahir

Thank you :slight_smile:
With those options it works fine now.

1 Like

@Clemens_Pestuka

You’re welcome.

1 Like