I want to use ghost4j convert pdf to image. I trying to use PDFDocument.extract to split PDFDcoument and multi thread to convert image. My PDF had some signature content like this picture. (https://i.stack.imgur.com/ydHiE.jpg)
I found only the pdf background will be extract and my renderer image only the pdf content without the signature image.
I had read this question.
Ghost4J native library to convert pdf to image
I also read the ghost4j web site. In my known, the PDFConverter class is build pdf not convert pdf to image. Is my acknowledge is correct or something I was wrong.
Here is my current code.
PDFDocument document = new PDFDocument();
document.load(file);
PDFDocument page = (PDFDocument) document.extract(1, 1);
SimpleRenderer renderer = new SimpleRenderer();
renderer.setResolution(96);
List<Image> images = renderer.render(page, 0, 0);
for (int j = 0; j < images.size(); j++) {
ImageIO.write((RenderedImage) images.get(j), "PNG", new File(outputPath + "-" + (j + 1) + "." + "png"));
}