mirror of
https://github.com/All-Hands-AI/OpenHands.git
synced 2026-01-09 14:57:59 -05:00
Replace deprecated PyPDF2 with pypdf (#12203)
Co-authored-by: openhands <openhands@all-hands.dev>
This commit is contained in:
@@ -22,7 +22,7 @@ import base64
|
||||
from typing import Any
|
||||
|
||||
import docx
|
||||
import PyPDF2
|
||||
import pypdf
|
||||
from pptx import Presentation
|
||||
from pylatexenc.latex2text import LatexNodes2Text
|
||||
|
||||
@@ -42,7 +42,7 @@ def parse_pdf(file_path: str) -> None:
|
||||
file_path: str: The path to the file to open.
|
||||
"""
|
||||
print(f'[Reading PDF file from {file_path}]')
|
||||
content = PyPDF2.PdfReader(file_path)
|
||||
content = pypdf.PdfReader(file_path)
|
||||
text = ''
|
||||
for page_idx in range(len(content.pages)):
|
||||
text += (
|
||||
|
||||
Reference in New Issue
Block a user