pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <spr...@gmx.eu>
Subject RE: convertToImage -> OutOfMemoryError
Date Wed, 05 Jan 2011 17:25:38 GMT
> PDDocument doc = PDDocument.load(new File("big.pdf"));
> PDDocumentCatalog catalog = doc.getDocumentCatalog();
> List pages = catalog.getAllPages();
> for(Object o : pages){
>   PDPage page = (PDPage)o;
>   BufferedImage image = page.convertToImage();//<= OOME
>   ImageIO.write(image, "png", file);
> }

OK, I got it. When the page is to big (e.g. really large images) then an
OMME is thrown.
Is there any possiblity to find out the approx. size of the page without
converting it into an image and catching the OOME?

Thank you


Mime
View raw message