Python, Automation, Data Science, Artificial Intelligence, Llm.
filename.endswith('.pdf'): # Open the PDF file pdf_path = os.path.join(pdf_directory, filename) with open(pdf_path, 'rb') as file: # Create a PDF reader object pdf_reader = PdfFileReader(file) # Extract metadata metadata = pdf_reader.getDocumentInfo() author = metadata.get('/Author', 'Unknown')