You can achieve this using LiveCycle PDF Generator JAVA API. You can find required code here:
In parameters:
//Set createPDF2 parameter values | |
String adobePDFSettings = "Standard"; | |
String securitySettings = "No Security"; | |
String fileTypeSettings = "Standard OCR"; |
"Standard OCR" file type setting will run OCR on input pdf. In the code, instead of doc file provide a pdf file. Resultant pdf will be searchable PDF i.e OCRed PDF.
Feel feel to ask any further questions.