Free Support Forum - aspose.com

Conversion of Excel File with too many cells to PDF

While converting an excel file to PDF as per Aspose Java library, loading a excel file its taking time to load and then saving the file. Its taking more time to load the file also.

workbook wb = new WorkBook(Filepath); //taking time

After applying LoadOptions Memory Settings this time is reduced to normal.

But After that when we write the save

wb.save(pdffilepath, pdfsaveoptions).// its taking time and not releasing the memory.

Even we do not know its saving the file or not. Its neither generating an exception for saving that xls file nor saving the file. Hence not releasing memory

During this time Memory consumption of the server goes high.

So for excel we have implemented the Interrupt Logic. So that if within 3 minutes if thread does not give any result then we have interrupt the thread.

Conversion from PPT to pdf and word pdf though we have not faced the issue yet.

But these processes also takes more CPU.

The CPU consumed is 40% during all the conversion process.

Xls top pdf, ppt to pdf, word to pdf

We are using the libraries below

aspose-cells-19.10.jar

aspose-words-19.7-jdk17.jar

aspose-slides-19.9-jdk16.jar

And after executing the conversion we have some files generated that never gets deleted in our server temp directory this happens for XLS as we are having issue in excel mostly

+~JF1180000881677717716.tmp

@gdnigam,
Please share your sample files with us for our testing. We will reproduce the problem and provide our feedback after analysis.

AnyConv.com__Aspose Excel File Prob.zip (311.5 KB)

Hi Find attach the file. We have a customer who has data in the attached format and aspose is not able to handle the conversion and putting our servers on stress with increasing the memory.

Could you please suggest a solution.

@gdnigam,

Please try using our latest version/fix: Aspose.Cells for Java v20.10.x.
I found your template file has many blank pages to be rendered in the PDF, so it would take some time to render those unnecessary large number of pages. Please try using the following lines to make sure blank pages should not be rendered in the output PDF. After adding these lines it works instantly and quickly as I tested and output PDF is generated fine:
e.g
Sample code:

 Workbook workbook = new Workbook("f:\\files\\Input.xlsx");
 workbook.getWorksheets().get(0).getCells().deleteBlankRows();
 workbook.getWorksheets().get(0).getCells().deleteBlankColumns();
 workbook.save("f:\\files\\out1.pdf");

Let us know if you still find any issue.

Hi
We are able to convert the file with no blank excel cells but after conversion of the file to pdf the memory of the JAVA process goes high and never comes down, as a result the system becomes slow.

find that attached file

https://dcirrus.io/api.acms/html/share_login.html?a=226&b=248

https://dcirrus.io/api.acms/html/share_login.html?a=227&b=248

Please suggest a solution at the earliest.

@gdnigam,

As you are using some older version of the API, so we recommend you to kindly try our latest version/fix: Aspose.Cells for Java v20.10.x with your template file and the suggested code below. The process is completed in just a few seconds with minimal memory use (there is no memory increase).
e.g
Sample code:

Workbook workbook = new Workbook("f:\\files\\Tab2_forTest_2.xlsx");
        workbook.getWorksheets().get(0).getCells().deleteBlankRows();
        workbook.getWorksheets().get(0).getCells().deleteBlankColumns();
        workbook.save("f:\\files\\out1.pdf");

See the attached output file with latest version/fix.
out1.pdf (2.9 MB)

Let us know if it does not work instantly with normal memory usage?

Thanks we will check.
Also we want to implement Aspose OCR in our system. At the moment we are only converting and viewing the files. Can you help.

@gdnigam

You can surely use Aspose.OCR at your side in order to perform operations over images. You can find information in the following articles to setup the API:

In case you face any issue, please feel free to let us know. You can also post your inquiry in Aspose.OCR forum category which is dedicated for Aspose.OCR related support.

if we upgrade, do we have to buy a new license or we can upgrade with the older one

@gdnigam,

Well, it depends. Please open your license file into notepad (please do not edit/update your license file, least it will not work anymore) and check your subscription expiry date. If the date is greater than the released Aspose API version, then you do not need to buy new license (just update to new version(s) of the APIs and continue using your existing license). If the subscription expiry date is lesser than the released date of the Aspose version(s), then you have to update your subscription.

Hope, this helps a bit.