I am using pdfbox to render a page to BufferedImage. The document is scanned sheet of paper (A4). Unfortunately, many of these documents have already been scaned and only OCR I have avaialable performs just while scanning. So I use tess4j to sort this documents.
try (PDDocument inputPDF = PDDocument.load(pdf)) {
firstPage = new PDFRenderer(inputPDF).renderImageWithDPI(0, 200);
However, this way of rendering is pretty slow. I need actually just a small part of the first page of that pdf, so rendering entire page is pointless. My question is: How to extract area as BufferedImage from pdf document. For example extract area sized 100x100 in upper right corner.
Thanks :)