I have a code to convert first page of pdf document to png format image. The code looks working fine with most of pdf file, except this one:https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0ahUKEwiqp4KovobSAhXJ54MKHdtbD54QFggeMAA&url=http%3A%2F%2Fitrevolution.com%2Fwp-content%2Fuploads%2Ffiles%2FPhoenixProjectExcerpt.pdf&usg=AFQjCNGYt1ALVc2ramVw_oM4Qb4rQCTDmw&cad=rja This document give me a white page for first page. Not sure what is wrong here.
PDDocument pdf = PDDocument.loadNonSeq(file, new RandomAccessFile(tmp_file, "rw"));
List<PDPage> pdPages = pdf.getDocumentCatalog().getAllPages();
PDPage page = pdPages.get(0);
BufferedImage bim = page.convertToImage(BufferedImage.TYPE_INT_RGB, 300);
ImageIOUtil.writeImage(bim, thumbnailPath + "/" + objectId + ".png", 300);