pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "von Daak, Frank" <Frank.vonD...@subreport.de>
Subject Re: High CPU load an memory usage, when converting PDF to Image
Date Wed, 22 Jul 2015 14:21:24 GMT
Great. Thank you for your help!

For us, it would be enough to identify such a file, before calling convertToImage(), to avoid
the high server load.
Do you think, there is a way to get this information out of the pdf?

Greets,
Frank

 


Am 22.07.2015 um 09:01 schrieb Tilman Hausherr <THausherr@t-online.de>:

> Thanks. According to virustotal.com, one (Dr.Web) of 51 programs claims that it is a
virus (SCRIPT.Virus). I've send it to them for analysis. In the meantime, I'm also trying
to display that file with 2.0 and nothing happens except my CPU heating the room. Either we
have a new bug, or the file is really very complex.
> 
> Reminds me that I have the same problem with this file:
> http://bugs.ghostscript.com/show_bug.cgi?id=692158
> 
> Tilman
> 
> Am 22.07.2015 um 08:11 schrieb von Daak, Frank:
>> Hi,
>> 
>> ah, ok.
>> 
>> Please find the pdf file at the following location:
>> http://82.165.25.239/buggypdf_nurgrafik.pdf
>> 
>> Greetings,
>> Frank
>> 
>> 
>> 
>> Am 22.07.2015 um 07:11 schrieb Tilman Hausherr <THausherr@t-online.de>:
>> 
>>> Hi,
>>> 
>>> It is not possible to attach PDFs here, please upload it somewhere so that we
can have a look.
>>> 
>>> Tilman
>>> 
>>> Am 22.07.2015 um 06:46 schrieb von Daak, Frank:
>>>> Hello!
>>>> 
>>>> We are running a business web application, that is using pdfbox to convert
pdf-files to images, using PDPage.convertToImage().
>>>> When we try to convert the attached pdf, the CPU load of tomcat is raising
and it seems, that the process hangs. The tomcat process is no more responsive and after a
long while, we get an memory overflow. Also the server load is very high meanwhile.
>>>> We have seen this on pdfbox 1.8.8, 1.8.9 and 1.8.11-SNAPSHOT
>>>> 
>>>> Do you have an idea, how to prevent this?
>>>> 
>>>> Our code looks like this:
>>>> 
>>>> private void convertPDF2JPG(File inFile, String outFile) throws Exception
{
>>>> PDDocument pdf = PDDocument.load(inFile);
>>>> List<PDPage> allPages = (List<PDPage>)pdf.getDocumentCatalog().getAllPages();
>>>> 
>>>> for(PDPage pdPage: allPages) {
>>>> int resolution = 220;
>>>> BufferedImage bufferedImage = pdPage.convertToImage(BufferedImage.TYPE_INT_RGB,
resolution);
>>>> Graphics2D bufImageGraphics = bufferedImage.createGraphics();
>>>> bufImageGraphics.drawImage(bufferedImage, 0, 0, null);
>>>> bufImageGraphics.dispose();
>>>> 
>>>> convertAnyImage2JPG(bufferedImage, new File(outFile));
>>>> }
>>>> 
>>>> }
>>>> 
>>>> 
>>>> Thank you very much and best regards,
>>>> Frank
>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>> For additional commands, e-mail: users-help@pdfbox.apache.org
>> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org


Mime
View raw message