#NEWLINE# def extract_pdf( self , meta , pdf_path ) : #NEWLINE# #INDENT# data = extract_pdf ( pdf_path , languages = self . get_languages ( meta ) ) #NEWLINE# if ( data is None ) : #NEWLINE# #INDENT# self . log_error ( meta , error_type = 'PDFSyntaxError' , error_message = ( 'Could not parse PDF: %r' % meta ) ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( ( not meta . has ( 'author' ) ) and data . get ( 'author' ) ) : #NEWLINE# #INDENT# meta [ 'author' ] = data . get ( 'author' ) #NEWLINE# #UNINDENT# if ( ( not meta . has ( 'title' ) ) and data . get ( 'title' ) ) : #NEWLINE# #INDENT# meta . title = data . get ( 'title' ) #NEWLINE# #UNINDENT# document = self . create_document ( meta ) #NEWLINE# for ( i , page ) in enumerate ( data [ 'pages' ] ) : #NEWLINE# #INDENT# self . create_page ( document , page , number = ( i + 1 ) ) #NEWLINE# #UNINDENT# self . emit ( document )