An invoice laid on a letterhead

An invoice laid on a letterhead somebody else made.

The letterhead already exists as a PDF somebody else made: a page with a header block on it and nothing else. It is read, brought in as a drawing, laid under the new page, and the invoice is set on top of it.

Nothing about the letterhead is rewritten: its fonts, its colours and its marks come across exactly as they are. This is how a document server uses the letterhead a customer supplies without having to understand, or set again, anything on it.

What this example shows

  • A page of an existing PDF, read and reused as it stands.
  • Its fonts and colours carried over untouched.
  • New content composed on top of imported stationery.

The code, in full

The same document is written twice, once in each language. Both files are shown in full, with the code coloured on the server, and can be copied in one click.

The document itself

The same document is written in each of these languages. Open the one you want to look at.

Open the document in English Open the document in French

Read the Rust source Read the Python source

First page of An invoice laid on a letterhead

What this document weighs

Before 218,913 bytes
Now 77,869 bytes
Saved 64.4 %

Not one mark on the page changed. See every document measured.

Examples near this one

A pack built on three supplied sheets

A supply agreement standing on three PDF files the customer sent: a headed sheet under the front page, a plain sheet under every page the schedule runs to, and a page of conditions that goes in whole.

The evaluation watermark

What an unlicensed copy looks like: the evaluation watermark the library stamps on every page.

An interactive form

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

An archivable PDF/A-3 form

A form that is also a PDF/A-3 file: every field already drawn, with a visible frame, expecting nothing from the reader's software.

A tagged, accessible document

A document that says what each run of ink stands for, and which runs are only trimmings. Its text and its table describe themselves, a paragraph and a cell at a time. Validates as PDF/A-3a and PDF/UA-1.

Every example, by subject