PagesCount is ignored when converting any XLSX to PNG in .NET

Converting any XLSX file to PNG results in multiple output files, although pagesCount is set to 1.

GroupDocs.Conversion 21.9.1 was used with .NET Framework 4.7.2 and the following code:

            using (var conv = new Converter(documentPath))
            {
                var options = new ImageConvertOptions()
                {
                    Format = FileTypes.ImageFileType.Png,
                    //convert only the first page for thumbnail
                    PageNumber = 1,
                    PagesCount = 1,
                    Width = 256 //pixel -> low resolution for thumbnail
                };
                Contracts.SavePageStream getPageStream = page => new FileStream(string.Format("Thumbnail{0}.png", page), FileMode.Create);
                conv.Convert(getPageStream, options);
            }

Thumbnail Range.zip (14.8 KB)

@Clemens_Pestuka

This issue is reproduced at our end. Hence, we’ve logged it in our internal issue tracking system with ID CONVERSIONNET-4896. You’ll be notified in case of any update.

1 Like

Hi @Atir_Tahir,

I also want to ask as a followup if there maybe is a better way to create thumbnails?
Just loading a file (by creating a Converter instance) already takes a lot of time and resources and I’m sure has a big overhead, when we just want to create a thumbnail.

We are also investigating this scenario. Your investigation ticket ID is CONVERSIONNET-4897.

1 Like