apyhub
Back

Add Page Numbers to PDF API

What it does

PDF Page Numbering adds page numbers to every page of a PDF and returns the updated PDF file.

Send a PDF as binary data in body.file, and choose how the numbering should appear with format, prefix, startAt, fontSize, position, pageRange, and skipFirstPage. Use plain for simple numbering, page-of-total for labels like Page 1 of 10, or prefixed when you want custom text before each number. You can also place numbers at the top or bottom of the page, control the font size, and limit numbering to specific pages.

Use PDF Page Numbering when you generate reports, invoices, exports, or internal documents that need consistent page labels before sharing or archiving them. It is also useful when you need to number only part of a document, leave the first page unnumbered, or match an existing document style.

The response is a binary PDF, ready to store, download, or pass into the next step of your document workflow.

POST
Add page numbers to every page of a PDF and return the PDF
https://api.eu.apyhub.com/freedailypro/add-page-numbers-to-pdf

QUICKSTART

GUIDE

Quickstart

Upload a PDF to add page numbers, then download the numbered PDF from the response.

curl -X POST "https://api.eu.apyhub.com/freedailypro/add-page-numbers-to-pdf" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf"

What you'll get back

Returns a binary file response containing the numbered PDF.

TRY ITLIVE · 10 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*
The PDF. Up to 20 MB.
plain = 1, 2, 3 (default); page-of-total = Page 1 of 10; prefixed = your prefix then the number (for example No. 1).
Text before the number. Only used when format is prefixed. Latin letters, digits and common punctuation.
Number shown on the first numbered page. A whole number from 1 up. Default 1.

About this endpoint

What it does

Adds page numbers to a PDF and returns the modified PDF as a binary file. You upload the PDF and can optionally control the numbering format, prefix, starting number, font size, position, page range, and whether to skip the first page.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe PDF. Up to 20 MB.
formatENUMNoNumbering format. Allowed values: plain (1, 2, 3, default), page-of-total (Page 1 of 10), prefixed (your prefix then the number, for example No. 1).
prefixStringNoText before the number. Only used when format is prefixed. Latin letters, digits and common punctuation.
startAtNumberNoNumber shown on the first numbered page. A whole number from 1 up. Default 1.
fontSizeNumberNoFont size in points, 4 to 72. Default 10.
positionENUMNoWhere to place the number. Allowed values: bottom-center, bottom-right, bottom-left, top-center, top-right, top-left. Default bottom-center.
pageRangeStringNoPages to number, from 1. For example 2-10 or 1,3,5-8. Default: every page.
skipFirstPageStringNotrue (also yes, 1, on) to leave page 1 unnumbered, also inside pageRange. Default false.

Response

Returns a binary file containing the PDF with page numbers added. The success response is a single binary string value.

ParameterTypeMandatoryDescription
stringStringYesBinary PDF output with page numbers applied.

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.