We have been using Aspose words/pdf for Java (licensed Aspose total). We have recently come to the observation that aspose libraries might be leaving open file descriptors for our java process, and these FDs remain open even when the file is deleted with “(deleted)” under /proc//fd .
The only way to close/ terminate such open FDs is to restart the java process.
Following is a code example of our implementation of creating a pdf from a base 64 content.
AsposeFileDto createPDFAspose(String content) throws DocumentException, IOException
AsposeFileDto output= new AsposeFileDto();
String dest = “resources/”+ UUID.randomUUID().toString() + “.pdf”;
byteValue = java.util.Base64.getDecoder().decode(content.getBytes()); com.aspose.pdf.Document pdfDocument; ByteArrayInputStream pdfFile = new ByteArrayInputStream(byteValue); pdfDocument = new com.aspose.pdf.Document(pdfFile); pdfDocument.save(dest); pdfDocument.close(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); com.aspose.pdf.Document pdfDocument1; pdfDocument1 = new com.aspose.pdf.Document(dest); pdfDocument1.save(baos); pdfDocument1.close(); output.setBaos(baos); return output; }
note: that both pdf document variables were closed.
Sample document attached.
8 Years O&M Amendment Agreement [Executed Version 26-05-2015] compressed_compressed - Copy (7).pdf (357.1 KB)
Prompt response with valuable insight and possible solution will be highly appreciated.