An invoice laid on a letterhead template

Every customer has their own letterhead, and not one of them will send you the fonts, the logo file and the exact colour it was printed in. What they will send is a PDF of it. Rebuilding that letterhead by hand means it comes out nearly right — on every document you produce for them, for as long as they are a customer.

So their own page does the work. It is laid down exactly as it stands — its fonts, its colours, its logo, just as they are in the file they sent you — and the invoice is written on top of it. Their letterhead therefore still looks like their letterhead, and their fonts and their colour come with it.

What this example shows

  • A template read once and reused as it stands.
  • Its fonts and colours carried over untouched.
  • New content composed on top of the page it lays down.

The source code, complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for the developer who uses this library. The third is the description itself: a plain list of what the page has to say, which is what the service is sent.

Read the Rust source Read the Python source Read the JSON source

The document itself

Open the document in English Open the document in French

An invoice laid on a letterhead template, first page

Optimised, this document weighs 23.1 kB — at least 85 % lighter than most PDF generators would write it

The document is lighter than it was, and every page still looks exactly the same. See this document's row in the table of every example.

Examples near this one

An agreement built on three supplied templates

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.

The watermark a trial copy carries

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.

An interactive form

A form a reader fills in: text boxes, a check box, a drop-down, radio buttons.

A document signed with a demonstration certificate

A page carrying a digital signature that any change to the file breaks, made with a certificate that exists only for the demonstration. Every command that made the key and the signature is printed on the page, with the one that checks it without this library.

Every example, by subject