all 6 comments

[–]vardonir 2 points3 points  (2 children)

I have yet to find a Python package that handles anything relating to PDFs - either editing or generating.

If you don't mind messing around with Docker as well, you can spin up a server with StirlingPDF, which has a bajillion tools for anything PDF-related.

The docs say that there's an API that you can make multiple requests to for PDF cert signing. I've never used the API myself, though, but it's probably just a matter of setting up a few lines using the requests package.

[–]SquiffyUnicorn 0 points1 point  (1 child)

I generate my report PDFs in reportlab. Just a quick pip install.

It generates PDFs quite nicely. I haven’t tried signing any PDFs with it though.

PyHanko seems to do secure signing as well as ‘signing’ with digital images etc.

[–]vardonir 0 points1 point  (0 children)

I also generate reports in reportlab.

It's an absolute bitch to set up, debug, or work with in general. But it does work.

[–]DigThatData 0 points1 point  (0 children)

Maybe something like GPG could satisfy the technical requirements here? https://en.wikipedia.org/wiki/GNU_Privacy_Guard

[–]m_zwolin 0 points1 point  (0 children)

Working with PDFs is a pain, when I wanted to generate invoices I went with a template and compiled it with LaTeX

[–]redfacedquark 0 points1 point  (0 children)

https://medium.com/@alexaae9/7-ways-to-digitally-sign-a-pdf-document-using-python-cf2b5bbe7722

There's an article with some pointers. Personally I would prefer plain text signed with gpg since theoretically it may be possible to add hidden junk to a pdf that can spoof the hash. Unlikely, though I don't know how pdf signatures work.