Skip to content
Permalink
Browse files

Properly close PDF snapshots loaded with pdfbox library

  • Loading branch information...
luccioman committed Mar 22, 2019
1 parent 74e6d6e commit 4d8a948455bbf7ab09e57eb4c24c6fda1bb11c28
Showing with 2 additions and 2 deletions.
  1. +2 −2 source/net/yacy/cora/util/Html2Image.java
@@ -348,8 +348,8 @@ public static boolean pdf2image(final File pdf, final File image, final int widt

// convert pdf to jpg using internal pdfbox capability
if (convertCmd == null) {
try {
PDDocument pdoc = PDDocument.load(pdf);
try (final PDDocument pdoc = PDDocument.load(pdf);) {

BufferedImage bi = new PDFRenderer(pdoc).renderImageWithDPI(0, density, ImageType.RGB);

return ImageIO.write(bi, imageFormat, image);

0 comments on commit 4d8a948

Please sign in to comment.
You can’t perform that action at this time.