This creates another problem for me. I am running PDFBox in a kubernetes
cluster on premises with limited resources. I can not setup persistent
volume claims nor ephemeral volumes, and I can not change how my pods are
started. I have limited resources and an emptyDir that is mounted on /tmp
where the temporary files go. The emptyDir is mapped to a portion of the
kubernetes node's memory, and this memory is shared with many other
services. All in all - I need to keep a very low memory and tempFile
footprint, hence the InputStream. Using RandomAccessReadBuffer with an
InputStream loads the entire PDF into memory, and I can encounter PDF
documents that can be over 1GB in size. So loading everything into memory
is not an option.

On Wed, Jan 31, 2024 at 10:10 AM Tilman Hausherr <thaush...@t-online.de>
wrote:

> On 31.01.2024 09:50, Lars Juel Jensen wrote:
> > In PDFBox2 I could do:
> >
> > PDDocument.load(inputStream, MemoryUsageSetting.setupTempFileOnly())
> >
> > But there is no equivalent to this in PDFBox3. How do I read a PDF from
> an
> > inputstream?
> >
>
> |Loader.loadPDF(new RandomAccessReadBuffer(inputStream),
> IOUtils.createTempFileOnlyStreamCache());|
>

Reply via email to