Hi,
We are using Aspose PDF for Java (23.8), but for some instances it fails to generate the PDF.
I know you will be asking code to reproduce it, but we ourselves are not able to reproduce the issue in lower environment. It happens only in PROD. Below are the details, please check once and see if similar issue raised earlier or is there any solution you can provide based on your experience.
- PDF generation works fine most of the time, but sometime for some cases PDF generation never complete.
- Whenever that happens, it start high utilization of utilizing system resources (cpu and memory), which eventually create the problem for whole application.
- Details of how we are using the code -
-
Creating an instance of com.aspose.pdf.Document
pdfDocument = new Document(); -
once everything is added to document we have below code -
log.info(“Starting Process Paragraphs”);
pdfDocument.processParagraphs();
log.info(“End Process Paragraphs”);
pdfDocument.optimize();
log.info(“End Optimize PDF”);
pdfDocument.setPageLayout(PageLayout.OneColumn);
log.info(“End set layout”);
pdfDocument.save(pdfFile);
log.info(“PDF Saved”);
pdfFile.close();
FontRepository.clear(); -
For some instances, whenever issue happens, we only see log for “Starting Process Paragraphs” and after that it hangs, it never complete it.
- Even though multiple retry of generating the PDF for same case, it never completes.
- The structure of PDF is similar to all other which are generating fine.
- We tried to check the content of PDF and removed all alphanumeric characters, removed regular special char (like ,.:'"[]{}\-()*&#$ etc.), than after that some special UTF 8 char was still there, like below.
óó$‘–’–’–––––––’’’––––––––’’–’–––––––’’’’’–––––––’’’í’’óó’ñ’‘‘ÓáÁ’;‘ñ’’’’’’Á’’$‘óó$’
’––’’––’’–––––––––’–’’–––––––’óóñÓáÁñ’**óó
- When we added same characters in lower environment with all other content, and tried to generate the PDF, it worked fine.
- We have a code snipped to take care of UTF 8 char like below
TextEditOptions teo = new TextEditOptions(false);
teo.setLanguageTransformationBehavior(com.aspose.pdf.TextEditOptions.LanguageTransformation.ExactlyAsISee);
Could you please with this situation and suggest what can be done?
We don’t have a sample code to reproduce the issue as we are also not able to reproduce it , but I have shared the details as much as possible. Please let me know if you are looking for anything else on this.