File size: 492 Bytes
456b206
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import pdfplumber


def extract_text_from_pdfs(pdf_files):
    """
    Extracts text from a list of PDF files.

    Args:
    pdf_files (list): List of paths to PDF files.

    Returns:
    list: List of extracted text from each PDF.
    """
    all_texts = []
    for pdf_file in pdf_files:
        with pdfplumber.open(pdf_file) as pdf:
            text = ""
            for page in pdf.pages:
                text += page.extract_text()
        all_texts.append(text)
    return all_texts