Content shown and hidden by layer

One floor plan on four layers a reader shows and hides: the furniture and the dimensions shown, the notes hidden until asked for, and a draft mark that is looked at but never printed.

One floor plan drawn on four layers a reader can show and hide. The walls are the page's own ink and are always there. Everything else belongs to a layer: the furniture and the dimensions start shown, the notes start hidden until somebody asks for them, and the draft mark is looked at but never printed.

Open the file and the reader lists all four layers by name. Print it and the draft mark is gone without anyone having touched anything, because the layer says what it is for. This is how one drawing serves a site copy, a client copy and a print, without being three files.

What this example shows

  • Named layers a reader lists, shows and hides.
  • Layers that start hidden, and layers shown but never printed.
  • Page content that belongs to no layer and is always drawn.

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 Content shown and hidden by layer

What this document weighs

Before 111,577 bytes
Now 41,120 bytes
Saved 63.1 %

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

Examples near this one

Cutting out what you draw

A field of stripes shown through two cut-outs: a disc from the nonzero rule, and a frame from the even-odd rule over two nested rectangles.

Transparency and blend modes

Half-transparent fills that overlap and mix, and one orange square laid over a blue bar in four different ways of mixing colours.

Gradients in a line and in a circle

Gradients in a line and in a circle painted into boxes the page cuts out: a two-colour blend across and another on the diagonal, a circular one whose outer colour is carried out to the corners, and one passing through three colours.

Text and shapes filled with a gradient

A gradient used as the colour something is filled with: a headline whose letters are windows onto a blend of three colours, and a panel filled with a circular one.

One drawing, placed many times

One badge built as a drawing and placed eight times, plus once at half size: the file holds the drawing once, however many times it is placed.

One pattern, repeated across whatever it fills

Six panels filled with repeating patterns — bars, dots, a slant got without redrawing the pattern, a brick wall, two patterns crossing, a wider gap — and a logo whose letters are windows onto the bricks.

Every example, by subject

Glossary

CMYK
The four inks a printing press lays down: cyan, magenta, yellow and black. A screen mixes light instead, so a document going to a press states its colours in inks, not in screen colours.