Error Sheet to Image

Hello !

I have troubles with Aspose Cells (, to transform sheet xlsx to image. I have this errors :

W/System.err: com.aspose.cells.CellsException: Invalid Region.Op - only INTERSECT and DIFFERENCE are allowed
W/System.err: at com.aspose.cells.zcbc.a(Unknown Source:305)
at com.aspose.cells.zcbc.a(Unknown Source:79)
at com.aspose.cells.zcbc.a(Unknown Source:6)
at com.aspose.cells.SheetRender.toImage(Unknown Source:19)




Thanks for the details.

Please paste your sample code (runnable) and attach your template file(if any) to reproduce the issue on our end, we will check it soon.

Thanks for reply.

Here the code (654 Bytes)

The function generateImages is called from an other Java class

patchSource="/storage/emulated/0/fibre/"; (path from smartphone huawei p20)
nameFile=“test-file.xlsx”; (an empty xlsx file for test)

Thanks again



Thank you for providing the sample code, however we need the template file as well. Could you please share the template file with us for our testing?

The template file ? Do you mean the xlsx file ? Sorry I’m newbie in Android Java


Yes, by template file we mean the XLSX file which is used in this testing. (1.1 MB)
Here are the two files tested. Both don’t work.
I want to extract Cells A62:X79 which contains photos.


We have logged the issue in our database for investigation and for a fix(if applicable). Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

CELLSANDROID-84 - Error shown while rendering sheet to image


According to this document, it seems that the API like Canvas.clipRect(RectF rect, Region.Op op) was deprecated in API level 26 and this started being enforced in Android P(API level 28).

Please try to build an app with targetSdkVersion less than 28. e.g. targetSdkVersion="25" . If the issue still exists, please share a runnable project and the Android version of your device as we have tested it fine with targetSdkVersion="18" and test it on Android 5.1(API level 22).

1 Like

Thanks a lot, it works with SdkVersion 25. Have a nice day !


Good to know that your issue is sorted out. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.