Jun 29, 2021 01:28 PM
(This post was last modified: Jun 29, 2021 01:29 PM by SkunT3llo.)
Hello to everyone, I need help about this little python script...
Basically I wanted to go thru my files and check which PDFs are password encrypted, but running this script, after 5 seconds I get this error:"PyPDF2.utils.PdfReadError: EOF marker not found"
Basically I wanted to go thru my files and check which PDFs are password encrypted, but running this script, after 5 seconds I get this error:"PyPDF2.utils.PdfReadError: EOF marker not found"
Code
import PyPDF2
import os
directory = "G:\PDFs"
for root, dirs, files in os.walk(directory):
for file in files:
if file.endswith((".pdf")):
selected = root + "\\" + file
pdfFile = open(selected, "rb")
pdfRead = PyPDF2.PdfFileReader(pdfFile)
if pdfRead.isEncrypted == True:
print(selected)


![[Image: 3943c24fb6058003233768a9747351d2.png]](https://fontmeme.com/permalink/171027/3943c24fb6058003233768a9747351d2.png)