When using PDFBox, we encounter an issue where if we call render on a PDDocument, it sometimes loses content, such as fonts or certain shapes.
Having dug into this, it looks to be caused by the use of SoftReference throughout the PDFBox code base. The JVM seems to reap the underlying contents of the PDDocument while it's attempting to render the image. As a result, we see org.apache.pdfbox.cos.COSDocument - Warning: You did not close a PDF Document at random intervals.
Has anyone else encountered this issue? If so, how was it solved? So far, our solution has been to write the contents to a file, then read and render.