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 create 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.

The letterhead is then read back off its own page: each run of its text, where it begins and the size it is set in, printed under the invoice. A run whose letters the file gives no way of reading is reported as unread, never guessed.

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 template's text read back, with where each run begins.

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 Open the document in German Open the document in Spanish Open the document in Italian Open the document in Portuguese

An Invoice Laid on a Letterhead Template, first page

The Same Document in Other Languages

Optimised, this document weighs 25.3 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.

A Template Whose Regions Are Filled by Name

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.

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