-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
is-featureA feature requestA feature request
Description
Explanation
IMHO pypdf deserves that the is_encrypted property be completed by is_signed (Digitally signed).
Code Example
How would your feature be used? (Remove this if it is not applicable.)
import pypdf
def is_signed(pdf_file_path):
reader = pypdf.PdfReader(pdf_file_path)
root = reader.trailer['/Root']; l_signed = False
if acroform := root.get('/AcroForm'):
if acroform and (sig := acroform.get('/SigFlags')):
l_signed = bool(sig & 1)
return l_signed
# inspired by the [OCRmyPDF](https://github.com/ocrmypdf/OCRmyPDF/) code
# Use:
reader = PdfReader(pdf_file)
if reader.is_signed:
print(f'{pdf_file!r} is digitaly signed...n')Metadata
Metadata
Assignees
Labels
is-featureA feature requestA feature request