Created
February 13, 2023 17:26
-
-
Save alihanekiz/4667897dca6038245b4011299ec8ddd8 to your computer and use it in GitHub Desktop.
PDF2TXT in Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importing required modules | |
from PyPDF2 import PdfReader | |
txtFilename = '' | |
pdfFilename = '' | |
text = '' | |
f = open(txtFilename, 'w') | |
reader = PdfReader(pdfFilename) | |
for page in reader.pages: | |
newText = page.extract_text() | |
text = text + newText | |
f.write(text) | |
f.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment