Description
When converting first page to image by this code for attached PDF:
private static BufferedImage computeImage(PDDocument document) throws IOException { int imageType = BufferedImage.TYPE_INT_RGB; int resolution; try { resolution = Toolkit.getDefaultToolkit().getScreenResolution(); } catch (HeadlessException e) { resolution = 96; } PDPage page = (PDPage) document.getDocumentCatalog().getAllPages().get(0); try { BufferedImage image = page.convertToImage(imageType, resolution); return image; } finally { page = null; } }
returned image is the of a white page.
Attachments
Attachments
Issue Links
- duplicates
-
PDFBOX-1019 PDF conversion to image crashes the JVM
- Closed