docs: public static File[] convertPdf2Png(File inputPdfFile) throws IOException {
          Path path = Files.createTempDirectory("tessimages");
          File imageDir = path.toFile();
  
          PDDocument document = null;
          try {
              document = PDDocument.load(inputPdfFile);
              PDFRenderer pdfRenderer = new PDFRenderer(document);
              for (int page = 0; page < document.getNumberOfPages(); ++page) {
                  BufferedImage bim = pdfRenderer.renderImageWithDPI(page, 300, ImageType.RGB);
  
                  // suffix in filename will be used as the file format
                  String filename = String.format("workingimage%04d.png", page + 1);
                  ImageIOUtil.writeImage(bim, new File(imageDir, filename).getAbsolutePath(), 300);
              }
          } catch (IOException ioe) {
              logger.error("Error extracting PDF Document => " + ioe);
          } finally {
              if (imageDir.list().length == 0) {
                  imageDir.delete();
              }
  
              if (document != null) {
                  try {
                      document.close();
                  } catch (Exception e) {
                  }
              }
          }
  
          // find working files
          File[] workingFiles = imageDir.listFiles(new FilenameFilter() {
  
              @Override
              public boolean accept(File dir, String name) {
                  return name.toLowerCase().matches("workingimage\\d{4}\\.png$");
              }
          });
  
          Arrays.sort(workingFiles, new Comparator<File>() {
              @Override
              public int compare(File f1, File f2) {
                  return f1.getName().compareTo(f2.getName());
              }
          });
  
          return workingFiles;
      }