What it does
Add page numbers to a PDF in any corner, centre or a custom spot, as 1, Page 1 or 1 of 12, with your own font, size and colour.
It reads one PDF file. You get: a PDF with the numbers on the pages you chose.
Step by step on the website
Use Add Page Numbers
Open Add Page Numbers on the website.
Open Add Page NumbersDrop your PDF file on the page, or choose it.
Choose your settings, or keep the ones already chosen:
- Position: Top left, Top centre, Top right, Middle left, Centre, Middle right, Bottom left, Bottom centre, Bottom right or Diagonal (Centre at first). Where the number sits on each page.
- Placement: Preset or Custom spot (Preset at first). A preset spot, or exactly where you click.
- Across: a number from 0 to 100% (50% at first). From the left edge to the right edge. Appears when Placement is Custom spot.
- Down: a number from 0 to 100% (50% at first). From the top edge to the bottom edge. Appears when Placement is Custom spot.
- Format: 1, Page 1, 1 of 12, - 1 - or Custom (1 at first). Page-number text format.
- Template: type the text. Write the text around the number: {n} is the page number and {total} the page count. Appears when Format is Custom.
- Font size: a number from 2.8 to 63.5 mm (21.2 mm at first). Text size in points before scaling.
- Font: pick a font from the font list. The font the text is set in. The list shows every font you can use, including fonts you uploaded; see the fonts guide for the full list.
To fine-tune, open More options:
- Scale: a number from 0.1 to 4× (1× at first). Makes the number larger or smaller without changing the font size.
- Prefix: type it in. Text before the number, such as “Page ”.
- Suffix: type it in. Text after the number.
- Page layout: Same on every page or Facing pages (Same on every page at first). Mirror the numbers on facing pages, as in a printed book.
- Facing pages: Outer edge or Inner edge (Outer edge at first). Keep numbers on the outer or the inner edge of each spread. Appears when Page layout is Facing pages.
- First number: a number from 1 to 1000000 (1 at first). The number the first numbered page shows.
- Style: Regular, Bold, Italic or Bold italic (Regular at first). Font style.
- Nudge right: type a number. Fine-tune the position in points; a negative value moves left.
- Nudge down: type a number. Fine-tune the position in points; a negative value moves up.
- Margin: a number from 0 to 84.7 mm (12.7 mm at first). Space kept clear at the page edge.
- Rotation: a number from -360 to 360°. Turn of the number in degrees, counter-clockwise, from -360 to 360 (decimals allowed; 0 and 360 are upright). The number sits at its spot, and stays whole on the page, by the box it covers once turned. When omitted it is 45 for the diagonal position, otherwise 0.
- Colour: pick a colour, or type a hex code such as #c62828. The text colour.
- Pages: type page numbers and ranges, such as 1-3, 5. Leave empty for every page.
- File name: type a name, or keep the one suggested. Optional. The extension is added for you.
Select Add Page Numbers to run it.
When it finishes, select Download to save your PDF file.
Settings
Every setting, with the name the page shows and the name the API uses. On the page: shown next to your file. More options: under More options. API only: not offered on the website.
| Setting | API name | Choices or values | Default | Where | What it does |
|---|---|---|---|---|---|
| Position | position | Top left (top-left), Top centre (top-center), Top right (top-right), Middle left (middle-left), Centre (middle-center), Middle right (middle-right), Bottom left (bottom-left), Bottom centre (bottom-center), Bottom right (bottom-right), Diagonal (diagonal) | Centre | On the page | Where the number sits on each page. |
| Placement | positionMode | Preset (preset), Custom spot (custom) | Preset | On the page | A preset spot, or exactly where you click. |
| Across | xPercent | 0 to 100% | 50 | On the page, when Placement is Custom spot | From the left edge to the right edge. |
| Down | yPercent | 0 to 100% | 50 | On the page, when Placement is Custom spot | From the top edge to the bottom edge. |
| Scale | scale | 0.1 to 4× | 1 | More options | Makes the number larger or smaller without changing the font size. |
| Format | format | 1 (number), Page 1 (page-number), 1 of 12 (number-of-total), - 1 - (dashes), Custom (custom) | 1 | On the page | Page-number text format. |
| Template (required) | template | Text | On the page, when Format is Custom | Write the text around the number: {n} is the page number and {total} the page count. | |
| Prefix | prefix | Text | More options | Text before the number, such as “Page ”. | |
| Suffix | suffix | Text | More options | Text after the number. | |
| Page layout | pageMode | Same on every page (single), Facing pages (facing) | Same on every page | More options | Mirror the numbers on facing pages, as in a printed book. |
| Facing pages | facingPlacement | Outer edge (outside), Inner edge (inside) | Outer edge | More options, when Page layout is Facing pages | Keep numbers on the outer or the inner edge of each spread. |
| First number | startNumber | 1 to 1000000 | 1 | More options | The number the first numbered page shows. |
| Font size | fontSize | 8 to 180 pt | 60 | On the page | Text size in points before scaling. |
| Font | fontFamily | Text | helvetica | On the page | The font the text is set in. The list shows every font you can use, including fonts you uploaded; see the fonts guide for the full list. |
| Style | fontStyle | Regular (regular), Bold (bold), Italic (italic), Bold italic (bold-italic) | Regular | More options | Font style. |
| Nudge right | xOffset | Text | 0 | More options | Fine-tune the position in points; a negative value moves left. |
| Nudge down | yOffset | Text | 0 | More options | Fine-tune the position in points; a negative value moves up. |
| Margin | margin | 0 to 240 pt | 36 | More options | Space kept clear at the page edge. |
| Rotation | rotation | -360 to 360° | More options | Turn of the number in degrees, counter-clockwise, from -360 to 360 (decimals allowed; 0 and 360 are upright). The number sits at its spot, and stays whole on the page, by the box it covers once turned. When omitted it is 45 for the diagonal position, otherwise 0. | |
| Colour | color | Text | #2e2e2e | More options | The text colour. |
| Pages | pages | Text | More options | Leave empty for every page. | |
| File name | outputName | Text | More options | Optional. The extension is added for you. |
Run it with the API
Upload your file with POST /api/v2/documents, then start Add Page Numbers with POST /api/v2/document-operations and toolId add-page-numbers. The parameters use the API names in the settings table; anything you leave out takes its default. Read the operation until its state is completed, then download the output version.
The request below uses the same starting settings as the website. The script after it does the whole journey: upload, run, wait and download.
{
"documentId": "doc_8kq2W1",
"versionId": "ver_3Jx9Lm",
"toolId": "add-page-numbers",
"parameters": {},
"idempotencyKey": "add-page-numbers-2026-11-22-1"
}#!/usr/bin/env bash
# Needs curl and jq.
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
set -euo pipefail
API="${WELLFRIEND_API_URL:-https://wellfriend.dev}"
WELLFRIEND_API_KEY="${WELLFRIEND_API_KEY:-YOUR_API_KEY}"
AUTH="Authorization: Bearer $WELLFRIEND_API_KEY"
RUN=$(uuidgen) # reuse this value to retry safely
# upload FILE CONTENT_TYPE KEY: prints the document id and its version id
upload() {
curl -sS --fail-with-body -X POST "$API/api/v2/documents" -H "$AUTH" -H "Idempotency-Key: $3" \
-H "Content-Type: $2" -H "X-Wellfriend-Filename: $(basename "$1")" --data-binary "@$1" \
| jq -r '"\(.document.id) \(.document.currentVersion.id)"'
}
read -r DOCUMENT_ID VERSION_ID < <(upload 'input.pdf' 'application/pdf' "$RUN-upload")
# Run add-page-numbers
OP=$(jq -n --arg doc "$DOCUMENT_ID" --arg ver "$VERSION_ID" --arg key "$RUN-1" \
--argjson parameters '{}' \
'{documentId: $doc, versionId: $ver, toolId: "add-page-numbers", parameters: $parameters, idempotencyKey: $key}' \
| curl -sS --fail-with-body -X POST "$API/api/v2/document-operations" -H "$AUTH" \
-H "Content-Type: application/json" -H "Idempotency-Key: $RUN-1" --data-binary @- | jq -r .operation.id)
while :; do
RESULT=$(curl -sS --fail-with-body "$API/api/v2/document-operations/$OP" -H "$AUTH")
STATE=$(echo "$RESULT" | jq -r .operation.state)
case "$STATE" in completed) break ;; failed|cancelled|canceled) echo "$RESULT" >&2; exit 1 ;; esac
sleep 1
done
DOCUMENT_ID=$(echo "$RESULT" | jq -r .operation.outputDocumentId)
VERSION_ID=$(echo "$RESULT" | jq -r .operation.outputVersionId)
# Download the result
curl -sS --fail-with-body "$API/api/v2/documents/$DOCUMENT_ID/versions/$VERSION_ID/content" -H "$AUTH" -o 'input-wellfriend.pdf'Run it with the SDKs
The SDKs upload the file, run add-page-numbers with the same parameters and wait for the result: wf.tools.addPageNumbers() in TypeScript, wf.tools.add_page_numbers() in Python, wf.Tools.AddPageNumbers() in Go.
// wellfriend-document-sdk: npm install wellfriend-document-sdk@latest. An ES module (top-level await): save it as .mts.
// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import { Wellfriend } from "wellfriend-document-sdk";
const wf = new Wellfriend({ apiKey: process.env.WELLFRIEND_API_KEY ?? "YOUR_API_KEY" });
const result = await wf.tools.addPageNumbers("input.pdf");
await result.save("input-wellfriend.pdf");# wellfriend-document-sdk: pip install -U wellfriend-document-sdk
# Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
import os
from wellfriend import Wellfriend
wf = Wellfriend(api_key=os.environ.get("WELLFRIEND_API_KEY", "YOUR_API_KEY"))
result = wf.tools.add_page_numbers("input.pdf")
result.save("input-wellfriend.pdf")// go get wellfriend.dev/go/wellfriend@latest
package main
import (
"context"
"fmt"
"os"
"wellfriend.dev/go/wellfriend"
)
func main() {
if err := run(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}
func run() error {
// Your API key: set WELLFRIEND_API_KEY, or replace YOUR_API_KEY (keys: https://wellfriend.dev/dashboard/developer-api/keys).
apiKey := os.Getenv("WELLFRIEND_API_KEY")
if apiKey == "" {
apiKey = "YOUR_API_KEY"
}
wf := wellfriend.New(wellfriend.WithAPIKey(apiKey))
ctx := context.Background()
res, err := wf.Tools.AddPageNumbers(ctx, wellfriend.File("input.pdf"), nil)
if err != nil {
return err
}
return res.Save(ctx, "input-wellfriend.pdf")
}