An Invoice Laid on a Letterhead Template
An invoice laid over a letterhead supplied as a PDF file.
A contract often arrives as a finished file somebody else wrote, with nowhere to sign it. Two people still have to sign it — one approves, one reviews — and the second signature must not break the first. Writing the file again would do exactly that: a signature is worked out from the bytes of the file, and a single byte moved breaks it.
This example never writes again the file it receives. It adds the two framed places to sign in a section written after the file's last byte, then signs the approval, then the review, each in a section of its own again. The review covers the whole file; the approval still covers exactly the bytes it covered, and still checks out. Both signatures use a certificate made only for this example, and the page prints the OpenSSL command that checks each of them without this library.
Last, the certificate both signatures rest on is kept inside the file, filed under each of them, in a section of its own. Years later, once the certificate has expired, the file still holds what shows that both signatures were valid on the day they were made.
Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library.
Read the Rust source Read the Python source
Open the document in English Open the document in French Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese
An invoice laid over a letterhead supplied as a PDF file.
A maintenance agreement somebody else sent, with a signature area, a date and a line of one's own laid over its last page, an annex added after it and an empty place to sign over the signature area, every byte of the agreement left where it was.
A supply agreement standing on three templates the customer sent: a headed page under the front page, a plain page under every page the schedule runs to, and a page of conditions that goes in whole.
A delivery label on which a designer named four rectangles, read back from its own file, placed four times and filled by those names alone: an address, an order number, a logo drawn from an SVG file and a return slip.
What you get before you pay anything: a watermark across every page, and the same pages under it, laid out exactly as a paid copy lays them out. This is also the document that says what a licence key changes, and why every figure on this site is measured with one.
A form a reader fills in: text boxes, a check box, a drop-down, radio buttons.