You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Oliver Breidenbach <ol...@googlemail.com.INVALID> on 2020/02/03 08:28:36 UTC
Interrupt long running renderings
Hi,
we are using pdfbox for creating previews of uploaded pdf files. Just
redering a image of the first page. This is working quite well for 99 % of
the uploaded files.
But sometimes the pdfs consists just of one page but with kind of a map on
it. I guess this map consists of thousands or millions of objects.
Such files eat up a lot of memory and take a long time.
Has pdfbox the possibility to limit the memory consumption and/or the
rendering time?
In our case it would be sufficient if the rendering would be interrupted
with an exception.
We could than use a default preview image.
Best regards,
Oliver
Re: Interrupt long running renderings
Posted by Tilman Hausherr <TH...@t-online.de>.
Am 03.02.2020 um 09:28 schrieb Oliver Breidenbach:
> Hi,
> we are using pdfbox for creating previews of uploaded pdf files. Just
> redering a image of the first page. This is working quite well for 99 % of
> the uploaded files.
> But sometimes the pdfs consists just of one page but with kind of a map on
> it. I guess this map consists of thousands or millions of objects.
> Such files eat up a lot of memory and take a long time.
> Has pdfbox the possibility to limit the memory consumption and/or the
> rendering time?
No... if we'd support interrupts, we would have to change the whole API
to throw this, because InterruptedException is a checked exception.
Re memory... it just grows until there's nothing left :-(
Tilman
>
> In our case it would be sufficient if the rendering would be interrupted
> with an exception.
> We could than use a default preview image.
>
> Best regards,
> Oliver
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org
Re: Interrupt long running renderings
Posted by Constantine Dokolas <cd...@gmail.com>.
Regarding memory consumption, we've solved this problem by using the
MemoryUsageSetting.setupTempFileOnly() setting in most places. For
rendering, we use PDFium, which is blazing fast.
Regards,
Constantine
--
There is a computer disease that anybody who works with computers knows
about. It's a very serious disease and it interferes completely with the
work. The trouble with computers is that you 'play' with them!
- Richard P. Feynman
On Mon, Feb 3, 2020 at 10:28 AM Oliver Breidenbach
<ol...@googlemail.com.invalid> wrote:
> Hi,
> we are using pdfbox for creating previews of uploaded pdf files. Just
> redering a image of the first page. This is working quite well for 99 % of
> the uploaded files.
> But sometimes the pdfs consists just of one page but with kind of a map on
> it. I guess this map consists of thousands or millions of objects.
> Such files eat up a lot of memory and take a long time.
> Has pdfbox the possibility to limit the memory consumption and/or the
> rendering time?
>
> In our case it would be sufficient if the rendering would be interrupted
> with an exception.
> We could than use a default preview image.
>
> Best regards,
> Oliver
>