Stirling PDF icon

Stirling PDF

Merged API: Stirling PDF - Processing API + Stirling PDF - Management API + Stirling PDF - System API

Actions260

Misc → Add Page Numbers

AI-generated

Summary

Add page numbers to a PDF file with customizable position, font, color, margin, and numbering format.

Inputs

  • fileInputBinaryProperty — Name of the binary property containing the PDF file data to be processed (default 'data').
  • fileId — File ID to reference a server-side PDF file instead of uploading binary data.
  • pageNumbers (required) — Specifies which pages to number; accepts 'all', ranges like '1,3,5-9', or functions like '2n+1'.
  • customMargin — Margin size for page numbers positioning: small, medium, large, or x-large.
  • fontSize (required) — Font size to use for the page numbers.
  • fontType (required) — Font type for page numbers: Helvetica, Courier, or Times.
  • fontColor — Hex color code for the page number text (e.g., #000000).
  • zeroPad — Number of digits to zero-pad page numbers; 0 disables padding.
  • position (required) — Position on the page to place the page number, from 1 (top-left) to 9 (bottom-right).
  • startingNumber (required) — The starting number used for the first page number inserted.
  • pagesToNumber — Specifies which pages to apply numbering to, similar to 'pageNumbers'.
  • customText — Text pattern for page numbers supporting placeholders: {n} for page number, {total} for total pages, {filename} for original file name.

Output shape

a single modified PDF file with page numbers added, returned as binary data

Output contains the updated PDF binary with page numbers overlaid according to the specified parameters. Input can be binary PDF data or referenced by file ID. Optional parameters control styling and page selection.

Links

Discussion