An invoice that asks before it claims

Every other document here reaches a standard by declaring it: the file says it is Factur-X, and it is written as Factur-X. Declaring is easy; being right is not. A document can name an invoice it never attached, claim a level of detail the XML inside it does not follow, and sit in a container the standard does not allow — and go out saying all three, to come back refused by the accounting department it was sent to.

So this one asks first. The library reads the document as it stands, writes nothing, changes nothing, and hands back everything it knows to stand between that document and the standard named — all of it at once, each finding citing the clause it comes from and the file it is about. Not the first fault and a stop: the list, so one round of work settles it.

The invoice here is composed the way somebody first writes it, and what comes back is printed. Two things stand in the way: it claims no archival standard, and it names factur-x.xml while carrying no file under that name. Put those right and one is left — it claims the EN 16931 level of detail where the XML follows Basic — because a file that is not there is a file nothing can read. Put that right and nothing stands, and the PDF is written. Nothing is written while anything stands.

An empty report is not a certificate. It says that nothing this library knows to look for is in the way, which is not the same as conforming: veraPDF, a free program with no hand in writing the file, is what says that. What the report does settle is the document contradicting itself, which is the one fault nobody further down can put right. The same three rounds run from Rust and from Python.

What this example shows

  • Every finding at once, each naming the clause it comes from and the file it is about.
  • Two in the way as first composed, one once the file is carried and the archival standard claimed, none once the level of detail claimed is the one the XML follows.
  • The document measured before a byte of it goes out, and refused rather than written while anything stands.

The source code, complete

Nothing is left out and nothing is simplified: this is the program exactly as it runs, for whoever writes your software.

Read the Rust source Read the Python source

The document itself

Open the document in English Open the document in French

Examples near this one

A sheet that measures what it says

Three rulers — centimetres, inches and points — on a page that tells whatever prints it to put it out at exactly the size it was drawn, and to offer nothing else. Lay a tape measure on the printed sheet and you can check for yourself.

A register whose pages say where they came from

Two sittings bound into one file. Each page carries a record of its own — what it is, whose hand wrote it, the day it was written — the photograph on the second page carries one too, and each transcription is tied to the page it transcribes rather than to the file at large.

A file that explains its own entries

A records office's reference, the department it came from, the date until which the document must be kept and its classification, carried inside a file an archive still accepts. No archiving rule knows what a keep-until date is, so each entry carries a description of itself, and that description is what makes a checker accept a fact you alone invented.

A delivery note that knows its own order

Every line of the note carries the order it was picked for, the article code and the shelf it came off, and prints none of them. The place where the driver signs carries the round and the van, and one beside the fold tick carries nothing but its own place.

A document that can be read aloud

Two pages carrying a copy of themselves that nobody sees: this is a heading, this is a table, and this is the order to read them in. Software reading the document aloud follows that instead of the order the marks were drawn in, and skips the running head. On the page, nothing looks any different.

A list whose pictures speak too

A parts list whose first column is a picture rather than a word. Each picture carries the sentence somebody hears in its place, so nothing in the list is lost on a reader who cannot see it. On the page, the pictures are simply pictures.

Every example, by subject