Dashed and Dotted Lines

An accountant's statement is easier to read when the rules between its rows are quiet: a hairline of dots rather than a solid line, and a dashed rule above the total. The usual way to get that is to draw a great many short strokes and hope the spacing survives a change of column width — which it does not, and the day the table gains a row somebody is counting dots by hand.

Nothing here is drawn twice over. Each rule is one single line told what to look like: the length of its dashes and of the gaps between them, the shape of its two ends, the shape of the corner where it turns. Widen the column and the dashes keep their spacing; add a row and nobody counts anything. A table is told the same thing once, and every rule in it, down to the border of one cell, comes out that way.

What This Example Shows

  • Dashes, dots and gaps, in any pattern, on any line.
  • Ends squared off, rounded, or run past the end of the line.
  • A table ruled with dots, and a total held off by a dashed line.

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

Examples Near This One

A Minimal PDF

Two identical pages that draw the structure of an invoice with lines and rectangles, without a word of text: the file is about a dozen kilobytes and embeds no font.

Showing Page One Before the File Has Arrived

The same document written twice: once as it is, once with its first page placed at the start of the file. The page gives, for each of the two, the number of bytes a browser must have received before it shows page 1.

Every Paper Size, on Its Own Page

One page for each paper size the library names, from A0 down to A6 and the American sizes, each giving its size in millimetres and inches; then pages laid on their side or upside down, and a banner ten metres long.

Every example, by subject