Skip to content

Make PDF read only #2627

May 6, 2024 · 1 comments · 12 replies
Discussion options

You must be logged in to vote

Something like that

import pypdf
r = pypdf.PdfReader("resources/FormTestFromOo.pdf")
for k,v in r.get_fields():
    o = v.indirect_reference.get_object()
    if o["/FT"] != "/Sig":
        o[pypdf.generic.NameObject("/Ff")] = pypdf.generic.NumberObject(o.get("/Ff",0) | 1)

Replies: 1 comment 12 replies

Comment options

You must be logged in to vote
12 replies
@thusharagokulnath
Comment options

@pubpub-zz
Comment options

@thusharagokulnath
Comment options

@pubpub-zz
Comment options

Answer selected by stefan6419846
@thusharagokulnath
Comment options

@pubpub-zz
Comment options

@Usouf
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #2626 on May 06, 2024 14:14.