0

I'm generating PDF files using an old library of iText on Unix. Everything is going fine, but my exploitation team has just contacted me telling they are having storage troubles with some temp files. After a discussion, they indicate me a lot of "Acroaxxxxx" files are created under /tmp folder. I'm checking it and the files are the same I generate with my application, but my code is not handling this.

My question is quite simple: can I modify or add something to my code to indicate to iText to delete the tmp file created during the process?

Thnks!

  • iText doesn't create any temp files. Certainly not older versions of iText. Your question is incomplete because (1.) you don't tell use which iText version you are using. (2.) you don't tell us how you are using iText. If I'd had to guess, I'd say that you are using an Adobe product next to iText, because `Acro...` files are created by Adobe products, not by iText. Note: in old iText versions, the only functionality known to be using temp files was digital signing. – Bruno Lowagie Sep 30 '16 at 09:23
  • Thanks for your answer. I'm using v1.1 of it, and unless there is a connector or something set up by Systems team, I think we are just creating the files by iText. To create the file, I'm doing as follows: outputStream = new FileOutputStream(pdfTargetFilePath); document = new Document(); document.close(); document.setPageSize(PageSize.A4); PdfWriter writer = PdfWriter.getInstance(document, outputStream); document.open(); // write info in the pdf – Miguel Bravo Yubero Oct 03 '16 at 08:30
  • Your code can't work because you `close()` the document before you even create a `PdfWriter`. Version 1.1 dates from November 2004; **that's almost 12 years ago!!!** You should upgrade! Also: your allegation that iText 1.1 creates temporary files is not correct. It is more likely that you are using `Runtime.exec()` somewhere. I was asking you for your code because I expect a reference to a class named `Executable` (or similar), but you aren't very helpful: the code you share is definitely not the code you're using. – Bruno Lowagie Oct 03 '16 at 08:55

0 Answers0