protected String getOCRText ( String filename , int pageNum ) { if ( filename != null && ! filename . isEmpty ( ) ) { api . TessBaseAPISetInputName ( handle , filename ) ; } Pointer utf8Text = renderedFormat == RenderedFormat . HOCR ? api . TessBaseAPIGetHOCRText ( handle , pageNum - 1 ) : api . TessBaseAPIGetUTF8Text ( handle ) ; String str = utf8Text . getString ( 0 ) ; api . TessDeleteText ( utf8Text ) ; return str ; }
Gets recognized text .