import pdfplumber import re file_path = '/home/x79/sisvietnamvn_01/sisvietnamvn_Trang chính thức hiện tại/DaoTao/2.-CHUONG-TRINH-CAN-THIEP-MACH-MAU-THAN-KINH-NANG-CAO-BO-SUNG-FINAL.pdf' with pdfplumber.open(file_path) as pdf: text = '' for page in pdf.pages: text += page.extract_text() + '\n' lines = text.split('\n') for line in lines: line_lower = line.lower() if any(k in line_lower for k in ['thời gian', 'đối tượng', 'thông tin lớp học', 'số lượng', 'hồ sơ', 'học phí', 'địa điểm nhận', 'hình thức']): print(line.strip())