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 06:11:53 GMT
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


Mime
View raw message