#NEWLINE# def _convert_page( layout , path , page_no , languages ) : #NEWLINE# #INDENT# text_content = [ ] #NEWLINE# for text_obj in _find_objects ( layout . _objs , ( LTTextBox , LTTextLine ) ) : #NEWLINE# #INDENT# text_content . append ( text_obj . get_text ( ) ) #NEWLINE# #UNINDENT# text = text_fragments ( text_content ) #NEWLINE# if ( len ( text ) < 2 ) : #NEWLINE# #INDENT# if len ( list ( _find_objects ( layout . _objs , LTImage ) ) ) : #NEWLINE# #INDENT# log . debug ( 'Defaulting to OCR: %r, pg. %s' , path , page_no ) #NEWLINE# text = _extract_image_page ( path , page_no , languages ) #NEWLINE# #UNINDENT# #UNINDENT# return text