A Template Whose Regions Are Filled by Name

A designer lays out a delivery label and marks where things go: the recipient's address, the sender's logo, the order reference, a leaflet page. The program that fills the labels in is written by somebody else, and usually it copies every one of those positions into its own code, as figures in points. The day the designer moves the logo, the program goes on printing it where it used to be.

Here the designer names four rectangles, says what each is filled with and how, and the list is kept inside the label's own file. The program never sees the layout: it reads the regions back, places the label four times on a sheet at three quarters of its size, and asks where each region landed. A coloured frame is drawn there, and it falls on the grey frame the designer drew. Each label is then filled by the names of its regions alone: an address, an order number, a logo, and a return slip taken from another PDF, whose own region is filled in turn. The last order number is set in red, a setting the program states over the region's own.

What This Example Shows

  • Four regions named on a template and kept inside its own file.
  • Each region found where it landed, the label drawn at three quarters of its size.
  • Every region filled by its name: text, a picture, another PDF's page.

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

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