A commercial invoice
An invoice whose lines and totals fall where the text puts them, and whose square code lets a telephone pay the exact sum into the exact account with nothing retyped.
Whole documents — invoices, delivery notes, payslips, contracts — and a small example for every feature they are built from, each creating a real PDF.
Every example comes with its code, written twice over: the same document once in Rust and once in Python. Most have a third button as well: the same document in JSON, the form sent to the service.
What each family is for View the PDFs hqf-pdf created See why the files are twice as light most of the time, often far more, and up to twelve times lighter
The documents a business sends out every day, produced by the software that already holds the figures. What this is for
An invoice whose lines and totals fall where the text puts them, and whose square code lets a telephone pay the exact sum into the exact account with nothing retyped.
The note that travels with the goods: a barcode against each article, a box the receiver ticks, and the consignment's own code.
A payslip: eighteen contribution lines with employee and employer shares, the month against the year to date.
A services agreement over two pages where no clause is ever cut in half by a page turn, ending in signature, name and date fields filled in on screen.
A certificate whose border, ribbon and seal are drawn as lines rather than photographed: sharp at any size, and a fraction of the weight.
A boarding pass carrying, as a square code, the one line the gates at an airport read — one character out of place and it is refused.
Fifteen shelf labels on one pre-cut sheet, each with its price and its scannable code, and trim marks in the margins. Six numbers describe the paper.
The ticket a counter till prints on a roll 80 mm across: six articles, the tax gathered by rate, the change worked out from the note handed over, and the barcode the shop scans when the ticket comes back.
The sheet a handover of premises produces: a plan of the floor at 1:300 with nine defects marked where they sit, the list of those defects one to a line, and what they come to. The marks stand above the page, and reading software lists them, filters them, and prints them or leaves them off the paper.
Three marks measured on the very words they cover: one showing the reason in the middle of its gap, one repeating it along the length of a wider one, one covering without a word. A mark states what must go; it does not take it out.
Three lots, each travelling as a file of its own, under the columns the document itself states — lot, day sent, total — sorted on the day, newest first. The cover sheet lays the same columns out for reading software that shows no pack.
A press proof carrying the run on the file, the plate on the page and the ink on the colour bar placed twice. None of it is drawn and no reading software shows it: it is there for the program that wrote it.
Four pages carrying three customer statements. Each one claims the pages it runs to, states who it is for and how many copies are owed, and carries its own attachment.
Four personal letters behind a contents page. No letter names a page number: each recipient takes the pages that follow, as many as are needed, and every line of the contents leads to the recipient.
Each of the families below takes one thing a page can carry and shows it on its own. They are here so that whoever writes your software can see exactly how each is done.
The page itself, the words on it, and the font — carried inside the file so the page looks the same everywhere. What this is for
Two identical pages carrying the bones of an invoice in plain shapes, and not a word of text: a file of a dozen kilobytes, with no font embedded.
The same document written twice, the ordinary way and with its first page moved to the head of the file, with how much of each must arrive before page one appears.
The same document written twice, plainly and packed, with what each one weighs and what the packing saved.
A page that opens with nothing typed and prints like any other, and that asks the reading software to leave its text where it is. Every word of it is scrambled inside the file.
A page nothing shows until its password is typed in: no first line, no preview, no picture of it anywhere. The password is given on the example's page, to be tried.
Text set in a font embedded in the file, cut down to the letters actually used, and still searchable, copyable and readable aloud.
A tick, a cross and a dash drawn by the program, added to the document as a font, and set among ordinary words.
Four fonts all reading software draws on its own, set on one page, so the file carries no font at all — and the example weighs the same lines both ways to say what that saves.
A font in Adobe's oldest format, the kind a print shop bought twenty years ago and almost nothing reads any more, carried whole into the file. Every figure the page states about it was read out of the font itself.
The same three lines written twice over — the ordinary way, then with each letter kept as a single byte — and the page states what each of the two came to. The short way also lets the space between the words of a line be set, which the ordinary way does not.
Dashes and dots, the shape of a line's ends, the shape of its corners: each drawn as one line under those settings. The statement at the bottom is ruled with dots, and its total held off by a dashed line.
You supply the text; the library works out where each line ends, where each column stops and where each page breaks. What this is for
A paragraph broken into lines, then laid out four ways: left, right, centred, justified.
A word longer than the column that holds it: the library leaves it whole, or cuts it at the column's edge.
A justified column set twice: the long words breaking at their soft hyphens with a hyphen shown, or left whole, and a figure a no-break space keeps together.
A justified column set twice: file paths and compounds running past the edge with no break points, then wrapping where a break after a slash or a hyphen is allowed.
A title, a rule, two paragraphs, a heading, a table of twenty-six rows and a footnote, handed over in reading order and broken across two pages by the engine.
One line of statuses set twice: in a company font alone, where the characters it has no glyph for come out as empty boxes, then with a second font behind it that draws them.
Four samples set twice each, once plain and once with a single setting activated: joined letters, small capitals, figures that hang below the line, and pairs moved closer together.
One long passage poured into three columns, each fitting the lines its height allows and handing the rest to the next.
The same two paragraphs six ways: as they come, a first line pushed in, a first line pulled out, the room above and below, a justified block whose last line is centred, and where the first and last lines sit in their rectangle.
A contents page whose entries are led to their page numbers by dots the layout draws.
A paragraph whose style changes inside it: size, underline, colour.
The same tabulated rows under each of the three methods, then a contents block whose dots run out to a stop on the right. A tabulation can step on from wherever the text stopped, land on the regular grid of a typewriter, or aim at a stop of its own, on which the text that follows starts, centres, or lines up by its decimal point.
Bulleted, numbered and nested lists, each built out of an indent that hangs out to the left and one tab stop rather than out of a dedicated list object: the marker sits in the room the indent opens, and every line below the first begins where the tabulation put the text.
What a document says about itself — DRAFT, COPY, PAID — laid across rectangles of four different shapes and scaled to each.
Headings of different lengths shrunk to share one column, and a label turned a quarter turn up the page's spine.
Eight badges cut to the same size, carrying names that run from two short words to a double-barrelled surname. The library finds, for each name, the largest size that fits its rectangle, and that size is printed underneath.
A seal whose legend rides its ring and a second one bowed at its foot so those words stand upright, a title bent over an arch, and the same sentence begun at three places along one straight path.
A public-domain English novel read into its twelve chapters and laid out across sixty-two numbered pages, behind a contents you can click, each chapter opening a page of its own and the engine choosing every line break.
The same layout on a French text: thirty-seven chapters over a hundred and sixty-nine pages, drawing the accented alphabet, so the font kept inside the file carries every shape a wider alphabet needs.
A half-price shelf card: every line shows the old price with a line through it beside the new one, the sum of the three carries a rule over the top, and the title is set a second time behind itself, shifted and paler, so it reads over anything.
Tables that fit their columns to the content, split across pages and repeat the heading row on each new page. What this is for
Twelve invoice lines is one page and thirty is two, the second taking up the first's header and layout.
What a cell can do with its own rectangle: the margin, the border, the room inside, the background.
A cell's four sides in four different colours, and coloured fills told apart from coloured borders.
A long table handed over whole, deciding for itself where the pages break: its heading on top of every page, its footnote under every page, its grey grounds stated once for the whole table, and a note you draw under each page at the exact place the table reports.
A specification sheet whose cells are merged down the rows: each group named once beside all of its rows, with one note beside them; the thin lines stop at those cells' edges, and a note too long for the rows it covers makes them grow.
One parts list twice: four columns sharing the width equally, then the reference, the quantity and the price each as wide as their own widest cell and the description given everything they leave.
A catalogue whose first column is a picture rather than text: four pictures of very different sizes and proportions, each fitted whole and undistorted into the cell the table gives it and standing against a different corner of it, claiming no width from its column and no height from its row.
A checking page for a pack somebody else sent: every row shows one of its pages, taken whole out of the file it arrived in, beside a stamp drawn once and placed in every row that was given it. Both are fitted to the cell the table leaves them, claiming no width from their column and no height from their row.
Overlong text in a narrow table cell: left to overflow the column, or cut to it.
An order of four lines and one of seven, in frames of the same height, both ending on the same bottom edge. Underneath, two notes of unequal length whose lines are moved apart until each reaches the foot of its frame.
Takings for thirty branches, quarter by quarter, over two pages. Every amount on the page carries the headings it stands under: the branch beside it, the quarter over it, and the year over the four quarters together. Read aloud, an amount is announced by its town, its quarter and its year before the sum itself.
The colour you set is the colour that goes to the press, and the printing works takes the file as it stands. What this is for
Swatches in each of the three ways to say a colour — a grey as one number, a screen colour as three, a printing colour as four inks — each captioned with the instruction actually written into the file, and one mid-grey said three ways.
The same six colours said as bare numbers and then read through the screen profile the file carries, plus a ramp from light to dark and a sweep of measured hues: colour that still means the same thing on another screen and on a press.
Two inks the press carries on a plate of their own, each at ten strengths, a piece of work set in both, and the alignment crosses used to line the plates up — drawn in an ink every plate answers to.
Eight choices of plate among the four usual inks, each with the small program that shows it printed underneath, and two inks the press carries itself used together, every strength of one against every strength of the other.
A chart of house colours the file carries, and a drawing whose sixteen numbers are places in that chart rather than colours. The same drawing is shown twice through two charts: repainting a whole brand is one chart, not every drawing.
One pattern that states no colour of its own, laid down in five colours and in five strengths of one press ink: the fill says what colour to lay it down in. Beside them, the same hatch made of patterns that carry their own colours, which is one pattern per colour.
One drawing on three pages: a press sheet stating where the ink runs, where the blade falls and what is worth keeping, with trim marks; the same sheet cropped to the finished page; and a landscape page that states a quarter turn clockwise on an upright sheet.
One sheet larger than the finished page: the colour runs three millimetres past the blade, the trim marks stand outside it in an ink every plate carries, every colour is said in the four printing inks, and the page names the paper, the edge of the ink and the cut. Hand it the profile of a press and it claims PDF/X-4, and the sheet prints on itself which profile it is standing on.
Six colours and a grey ramp painted three times over with the very same numbers: first left to the device, then said in two ways that state the white they are measured against, the curve applied to them, and how far the base colours reach. All of that travels in a handful of numbers, with no profile to carry.
The device a file's colours were chosen for, named in plain words on the page it applies to, with a ramp and one patch per base colour painted through that device's own profile. Your printing works' description does just as well.
Four ways of writing down the rule a colour follows rather than the colours themselves: measured colours read off a table, a range cut into flat bands, one printing ink shown on a screen, and two rules joined end to end.
The ICC profile the library embeds in a PDF/A file.
Lines, shapes, gradients and transparency drawn as instructions in the file, not as pixels — sharp at any size, and weighing almost nothing. What this is for
A pie of where the hours went, a ring gauge of how far into the year the work is, a card with eased corners, and arcs told where to go rather than how far to turn.
The same area of stripes shown through two windows: a plain disc, and a ring whose middle is left bare.
Half-transparent fills that overlap and mix, and one orange square laid over a blue bar in four different ways of mixing colours.
Four blends and what each one is for: a header that fades out, the same on the diagonal, a glow carried past its own circle so the corners fill, and one that goes by way of a third colour.
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 triangle running red to green to blue, a grid of sixty with its edges stroked over the paint, the same grid in the four printing inks, and the mesh once more named as a fill and painted inside a disc.
The same floor plan on four layers shown and hidden one at a time: the furniture and the distances shown, the internal notes hidden until asked for, and a draft watermark meant for the screen and not for the paper.
A land plan whose layers decide by themselves when to appear. A wide name stands over the plot while the plan is looked at whole, the fine wall figures come in once it is enlarged twice over, and the sentence under the plan is there in two languages, of which reading software shows the one it is set to.
One badge built as a drawing and placed eight times, plus once at half size: the file carries the drawing once, however many times it is placed.
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 name in large letters set in the brickwork.
The same block of colour four times over, each seen through a stencil of its own: a fade for a photograph under a headline, darkened edges to hold the eye, letters cut clean out of it, and a stencil taken from a shape already drawn.
Photographs placed at the size and the position you choose, from the image files a camera or a scanner already produces. What this is for
A photograph that goes in exactly as it came out of the camera, and one with transparent parts that keeps them, each on a page cut to its own size.
The four picture formats read — JPEG, PNG, BMP and TIFF — shown across every picture shipped with the library, each captioned with what its own file declares.
A file of three sheets and a file holding one photograph, each picture on a page cut to its own size; the photograph goes in exactly as the camera wrote it, since reading software reads a photograph itself.
One picture fitted into a rectangle of one size eight ways: three ways of sizing it, the same one stood in the top left corner with a 12-point inset, a quarter turn left, a quarter turn right, a turn of 20 degrees, and a left-to-right mirror — every panel drawing the picture at the place and the size the library worked out.
The codes a till, a warehouse scanner, a boarding gate or a phone reads, printed straight onto the document. What this is for
Stripes for the two jobs that want them: Code 128 for any text at all, and the three a till reads — EAN-13, UPC-A, EAN-8 — each with its last digit worked out rather than typed.
The code an invoice, a boarding pass or a label ends up wanting, drawn into the document rather than fetched as a picture and pasted in.
The code industry marks small parts with: still readable at sizes where a QR code has given up, on a circuit board or a phial in a laboratory tray.
The code on identity documents and shipping papers: it carries far more text than a row of bars, and it survives a laser scanner dragged across it.
The code on rail and airline tickets, and the reason is room: it needs no band of white around it, which is the first thing trimmed off a layout that has run tight.
Boxes the person receiving the form fills in on screen, and your text laid over a template: a PDF file somebody else already made. What this is for
An invoice laid over a letterhead supplied as a PDF file.
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.
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.
A form a reader fills in: text boxes, a check box, a drop-down, radio buttons.
A form that is also a PDF/A-3 file: every field already drawn, with a visible frame, expecting nothing from reading software.
Documents that will still open decades from now, that a screen reader can read aloud, and that an accounting system can book without anyone retyping them. What this is for
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.
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 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.
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.
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 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.
The electronic invoice French law has required since September 2026: one file, a page a person reads and the same invoice inside it as XML. Nothing to reconcile afterwards, because there is only ever one invoice.
The library reads the invoice as it stands and names, clause by clause, everything between it and Factur-X. Two things stand in the way, then one, then none — and only then is a file written.