Java PDF Read Write Extract Text: Reader/Writer/Extract Text Library/Component/API - Create, Modify, Read, Write PDF files and Extract text and images from PDF files using Java - with FREE trial, source code can be obtained through licensing.

OCR PDF Files with Asprise Java PDF Reader (with Text Extract)/Writer Library and Asprise OCR Engine

Sample code:

import com.asprise.util.pdf.PDFReader;
import com.asprise.util.ocr.OCR;

PDFReader reader = new PDFReader(new File("my.pdf"));
reader.open(); // open the file. 
int pages = reader.getNumberOfPages();
 
for(int i=0; i < pages; i++) {
   BufferedImage img = reader.getPageAsImage(i);
   
   // recognizes both characters and barcodes
   String text = new OCR().recognizeAll(image);
   System.out.println("Page " + i + ": " + text); 
}
 
reader.close(); // finally, close the file.

For more details on Asprise PDF library, please read Developer's Guide or view the Javadoc.

For more deitals on Asprise OCR engine, please visit this page.


< < Go back to product page



ALL RIGHTS RESERVED BY LAB Asprise! © 1998 - 2008. Terms of Use | Privacy Policy