Español

Lee este artículo en español.

How to add page numbers to a PDF (reports, contracts, dossiers)

Plenty of PDFs don't have page numbers. It happens mostly with:

In any of these cases the problem is the same: you need to add the numbering without rebuilding the document by hand, and sometimes without it matching the real page count.

Adding the numbering

With Add Page Numbers to PDF you set where the number goes with position: six possible combinations, top or bottom (top/bottom) crossed with left, center or right (left/center/right). It defaults to bottom center (bottom-center).

The text itself is controlled by format, which always has to include the {n} placeholder (leave it out and you get an error), for example Page {n}. You can optionally add {total} for something like Page {n} of {total}; the default format is just {n}.

Starting from a number other than 1

If the document continues from another one (an appendix, a volume 2) or you want to reserve the first pages for a cover and table of contents without numbering them with the real count, use start to set which number to begin at (0 to 100000, default 1).

Numbering just a range

With pages you choose which pages get numbered (for example 3-20, leaving out the cover and table of contents). One important detail: the numbering is sequential within your selection, it doesn't use the document's real page number. If you select pages=5-10, the actual page 5 gets whatever number is set in start (by default, "1"), not a "5". And {total} always shows the total pages of the whole document, not just the range you selected.

FAQ

Can I show "Page X of Y"? Yes, with format=Page {n} of {total}. {n} is required; {total} is optional and always counts the whole document, not the range you chose.

Why doesn't the first page of my range show its real page number? Because the numbering is sequential within the range you select, not absolute. For the real page 5 to show a "5", set start=5 when selecting pages=5-10.

Can I change the size or color of the number? Yes: font_size (6–72, default 10) and color in hex (default #000000). You can also adjust the distance from the edge with margin (0–200 points, default 24).

How much does it cost to number a 200-page PDF, and what format do I get back? 1 call = 1 credit, whether you number 1 page or 200. By default you get a PDF back if you send the raw file, or JSON with the PDF as base64 if you send JSON; force it with output=pdf or output=json.

Try these tools

You'll find the full instructions for Add Page Numbers to PDF, with examples for n8n, Make and your own code. And if you don't have an account yet, you can create one for free.