svenssonaxel / pdf-sign

A tool to sign PDF files. With Linux support.
MIT License
117 stars 3 forks source link

Request: Add date #9

Closed GregorySchwartz closed 1 day ago

GregorySchwartz commented 2 months ago

Most forms that require a signature also require the associated date. It would be nice to add a feature to add not only a signature, but also text or at least the date.

svenssonaxel commented 2 months ago

I agree that dating would be useful, but I don't want such a feature to complicate the interface too much. If you are willing to provide ideas, feedback and critique on the design, then perhaps we can work out a good design together. I'd like the design to fulfill at least the following:

Starter problem: Right now you can simply click in the GUI to position the signature. How could this feature be added without making that less intuitive?

I can't promise to work on this in a timely manner even given the design, but it's safe to say I won't without it!

svenssonaxel commented 1 month ago

Also, if it's a PDF form you can fill out the form including the date and save it, then sign.

rocketraman commented 1 week ago

The interface used by Adobe Reader to do Fill and Sign is pretty good. You could take inspiration from there :-) The main Fill and Sign controls are basically:

I would love to have a native Linux app that can do all this. At the moment I have to fire up a Windows VM every time.

svenssonaxel commented 1 week ago

I suppose signatures, initials, check marks and cross marks can all be individual pdf files that you can include in your signature directory. That would mean no functionality has to change. Perhaps I can even include a few pdf files in the repository that many people could find use for, e.g. check- and cross marks.

Adding more than one thing to a pdf is technically already supported too; you just have to run pdf-sign twice.

If you had a small pdf containing only the text you want to add, e.g. today's date, you could technically use pdf-sign with that. But this no longer seems so simple, because then you'd need to find a way to create such a pdf. So perhaps that should be added; a way to temporarily add a "signature" made up by a certain text. For example, --text "2024-07-06" would add a pre-selected signature option for that particular run. I think this has potential to be a simple enough design. Does it sound usable in practice?

rocketraman commented 1 week ago

Personally I'd prefer a simple GUI menu or controls over an interface like that similar to Acrobat Reader, but at least that would offer a working approach.

svenssonaxel commented 5 days ago

I now have a draft solution, pushed to branch dev. As before, all functionality is reachable both through CLI and GUI. Oh, and I also added another tool pdf-from-text if you want to create reusable signatures from a line of text. Let me know what you think!

GUI

In order to date and sign a pdf, you'd do it in two steps:

CLI

pdf-sign -bt `date -I` -y 0.65 -o document.dated.pdf document.pdf
pdf-sign -bs path/to/my/signature.pdf -o document.signed.pdf document.dated.pdf