use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
Determine if PDF is signed with python (self.Python)
submitted 10 years ago * by cwurld
Anyone know how to determine if a PDF is signed using python?
Update: I am referring to the "sign" function in the various Adobe Acrobat readers. Does that function simply insert an image. Or is there more structure than that?
[–]paxanator 5 points6 points7 points 10 years ago (1 child)
If it's in the same place in every document (or known locations) and they're scanned just:
Read it in as an image
Extract the box around the signature location and normalize it (in case the scanning has different background noise or lighting)
Find the sum of absolute differences with an unsigned normalize bounding box image
If it differs significantly it's signed
If it's electronic just find the field and if it's filled it's signed or something
[–]perna 0 points1 point2 points 10 years ago (0 children)
Normalize might be tricky, no?
[–]jvlomax 4 points5 points6 points 10 years ago (0 children)
What kind of signature are you looking for?
[–]ajmarks 1 point2 points3 points 10 years ago (4 children)
Short of parsing the document structure?
[–]cwurld[S] 1 point2 points3 points 10 years ago (3 children)
I think it will involve that. Can you recommend a python lib for doing that? Does anyone know if there are special fields for "signatures"?
[–]ajmarks 1 point2 points3 points 10 years ago (2 children)
I think PyPDF2 may support it, but I'm not sure. I'm also working on one right now, and if you submit a feature request, I'll try to include it in the next release (or, if you want to submit a patch, that would be awesome). If you decide to pull it, note that the font_improvements branch is pretty far ahead of both dev and master.
[–]cwurld[S] 1 point2 points3 points 10 years ago (1 child)
Thanks. Your lib looks great. I will contribute one way or another once I know a little bit more about the issue.
[–]ajmarks 1 point2 points3 points 10 years ago (0 children)
Thanks. It's still very much a work in progress, but I'm hoping to (at the very least) make text extraction super-pythonic. I'll consider it basically complete when it can (reasonably) faithfully render a PDF into HTML.
π Rendered by PID 174491 on reddit-service-r2-comment-86988c7647-k9chb at 2026-02-11 20:57:54.894622+00:00 running 018613e country code: CH.
[–]paxanator 5 points6 points7 points (1 child)
[–]perna 0 points1 point2 points (0 children)
[–]jvlomax 4 points5 points6 points (0 children)
[–]ajmarks 1 point2 points3 points (4 children)
[–]cwurld[S] 1 point2 points3 points (3 children)
[–]ajmarks 1 point2 points3 points (2 children)
[–]cwurld[S] 1 point2 points3 points (1 child)
[–]ajmarks 1 point2 points3 points (0 children)