Please do you have a full worked example to convert a pdf to text using the latest version of Aspose OCR for java? The below code (using Apache pdfbox) used to work but having converted to the latest release 20.11, each line is cut off at the end, ie each line of text generated after ocr is missing the last 10 or so characters…
PDDocument pdDoc = PDDocument.load(p_stream);
PDFRenderer pdfRenderer = new PDFRenderer(pdDoc);
for(int i=0; i<pdDoc.getPages().getCount(); i++)
AsposeOCR ocr = new AsposeOCR();
RecognitionSettings settings = new RecognitionSettings();
RecognitionResult result = ocr.RecognizePage(pdfRenderer.renderImageWithDPI(i, 300), settings);
for (String text: result.recognitionAreasText) {
t_text.append(text);
t_text.append(p_rq.t.linefeed);
}
}
pdDoc.close();