#pip install PyPDF2 import PyPDF2 from docx import Document def convert_pdf_to_word(pdf_path, word_path): pdf_file = open(pdf_path, 'rb') pdf_reader = PyPDF2.PdfReader(pdf_file) doc = Document() for page_num in range(len(pdf_reader.pages)): page = pdf_reader.pages[page_num] text = page.extract_text() doc.add_paragraph(text) doc.save(word_path) pdf_path = 'jl.pdf' # 替换成你的PDF文件路径 word_path = 'jl.docx' # 替换成你想要保存的Word文件路径 convert_pdf_to_word(pdf_path, word_path)