at com.aspose.cells.cxt.a(Unknown Source) ~[aspose-cells.jar:24.7.0]
at com.aspose.cells.kk.a_(Unknown Source) ~[aspose-cells.jar:24.7.0]
at com.aspose.cells.Workbook.a(Unknown Source) ~[aspose-cells.jar:24.7.0]
at com.aspose.cells.Workbook.save(Unknown Source) ~[aspose-cells.jar:24.7.0]
So I’m trying to convert excel to pdf using our auto-rendition feature but it fails at times but we are manually able to render it as pdf.
Can I know what is the reason for the null pointer exception?
Sample Code:
FontConfigs.setFontFolder(“C:\Windows\fonts”, false);
Workbook doc = new Workbook(“source_file_path”);
@John.He
This is happening randomly to all the .xlsx and .xlsm files
We suspect this is not file specific issue.
We want to know at what cases this type of issue occurs
If the issue occurs randomly, I guess this is due to your sample code when you render/save to PDF on your end, so you need to evaluate your code snippet thoroughly and step by step to trace and fix it on your end. We are sorry but without a simulation code or test case and resource files, we cannot reproduce the issue and hence cannot help you much.
It is hard for us to guess the cause of the exception without those resources that can reproduce the issue. Are you doing the conversion in multi-threads environment?
@John.He@amjad.sahi@johnson.shi
I’ll share the input in a day
Just want some info. So we are running the transformations in multi threaded environment. Will Workbook (aspose.cells) support multi threaded transformations?? To be particular will it support multiple transformations at a time?
@rsv2
Currently, multi-threaded conversion operations are not supported. Aspose.Cells only supports reading cell values in multiple threads simultaneously. Please refer to the following document.
@John.He
So are you trying to say that a single workbook instance cannot support multiple threads??
so what can be the resolution to it to support our case where multiple renditions are given
@rsv2
Thank you for your feedback. Your understanding is correct. Currently, a single workbook does not support multi-threaded saving and only supports multi-threaded data reading.
We are afraid currently there is no solution to support modifying/rendering one Workbook instance in multi-threads concurrently. We think you may create or copy the Workbook instance to get multiple instances of workbook and use them separately in different threads.
@amjad.sahi@johnson.shi@John.He
So in our product we are creating fresh workbook instance each time and give the transformation
sample code :
public void transformation(){
FontConfigs.setFontFolder(“C:\Windows\fonts”, false);
Workbook doc = new Workbook(“source_file_path”);
//excel to pdf conversion code
// pdf saving code
}
So we are importing multiple files parallelly but still each thread will pick up fresh workbook
Then its not a problem right?
@rsv2
Thank you for your feedback. Your understanding is correct. You can handle a fresh workbook in each thread. But multiple threads cannot handle the same workbook simultaneously.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
Enables storage, such as cookies, related to analytics.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.