Ensure SkiaSharp can be used for rendering

Hi GemBox Team,

I am trying to render a spreadsheet as image without using WPF in a windows service, so I set the rendering mode to Skia and referenced the SkiaSharp and HarfBuzzSharp packages with the native assets for Win32. However with high memory consumptions sometimes I still get some errors regarding dispatchers, so I’m quite sure the using of only Skia did not really work.

Is there some way to check, if all references for using Skia as rendering mode arepresent? Or are there other operations than saving as image that require WPF? Or can I somehow force the service to use Skia or fail, if that is not possible?

Kind regards,
Sarah

Hi Sarah,

If you’re still getting errors regarding the dispatcher, then WPF is still being used for something.
For example, are you printing workbooks, are you saving to workbook to PDF, are you using ExcelFile.GetPaginator(), ExcelFile.ConvertToImageSource(). or ExcelFile.ConvertToXpsDocument() methods?

Nevertheless, can you please try again with the current latest versions:

In the newer versions, we added support for WpfHelper class.

Also, please note that GemBox.Spreadsheet for .NET Standard doesn’t use WPF.

So perhaps a solution for you could be to use GemBox.Spreadsheet for .NET Standard as a private assembly (instead of installing GemBox.Spreadsheet via NuGet)?

Hi Mario,

the newest package version performs better and I don’t receive any errors anymore!
Is there any way to use Sika also for paginating the excel? Just in case the behaviour re-appears on a system with full memory consumption…

Kind regards,
Sarah

Hi Sarah,

Currently, not all options (including PaginatorOptions) have support for setting the RenderingMode.
So, for now, the best option would be to add a direct reference to GemBox.Spreadsheet for .NET Standard.

Regards,
Mario