Add Page Numbers to PDF API
Add custom page numbers, Bates numbering, and pagination to PDFs programmatically. Perfect for legal teams managing briefs, compliance departments tracking documents, and SaaS products that need automated document numbering. Works seamlessly with our PDF stamping API for complete document control.
No credit card required • Free tier available
Page Number API Example
REST APIcurl -X POST "https://api.xspdf.com/v1/manipulate/page-numbers" \
-H "Authorization: Bearer $API_KEY" \
-d '{"input_url":"https://files.example.com/legal-brief.pdf","options":{"format":"Page {n} of {total}","position":"bottom-center","font_size":10,"start_number":1}}' Speed
285ms
Success
99.95%
Options
12+
8,700+
Active Teams
285ms
Median Latency
99.95%
Success Rate
50M+
Pages Processed
Manual Page Numbering Wastes Hours Every Week
Legal teams, compliance departments, and document management systems lose countless hours adding page numbers manually. Every brief, filing, or report needs perfect pagination.
Hours of Manual Work
Opening Adobe Acrobat, configuring page numbers, adjusting formatting for every document. Legal assistants spend 4-6 hours weekly on pagination alone.
Numbering Errors Cost Cases
Wrong page numbers on legal briefs can lead to rejected filings. Inconsistent Bates numbering creates discovery nightmares. One mistake delays entire proceedings.
No Automation for Custom Formats
Courts require specific formats. CASE-001-0001 for discovery. Page 1 of 47 for briefs. Custom prefixes for exhibits. Desktop tools can't handle batch automation.
The Hidden Cost of Manual Pagination
A legal assistant making $65,000/year spends 5 hours weekly on page numbering. That's $8,125 annually in labor costs. Add filing delays, correction time, and Adobe licenses for the entire team. Total annual cost for a 5-person team: $28,000+.
xspdf automates the entire workflow for $99/month. ROI in the first week.
Add Page Numbers in One API Call
Upload a PDF, specify your format, get perfectly numbered documents back in under 300ms. Bates numbering, custom prefixes, and any pagination format you need.
Custom Format Strings
Use {n} for current page, {total} for total pages. Add prefixes like "CASE-001-" for Bates numbering. "Page {n} of {total}" for legal briefs. Full control over formatting.
Position Anywhere
Bottom-center, top-right, custom coordinates. Set margins, font size, color. Skip first page or number only specific ranges. Full layout control via API parameters.
Batch Process Thousands
Number entire case files in minutes. Sequential Bates numbering across multiple documents. Webhook notifications when batches complete. Enterprise-grade reliability.
Python SDK Example
pip install xspdfresponse = requests.post(
"https://api.xspdf.com/v1/manipulate/page-numbers",
headers={"Authorization": f"Bearer {API_KEY}"},
json={
"input_url": "https://files.example.com/legal-brief.pdf",
"options": {
"format": "Page {n} of {total}",
"position": "bottom-center",
"font_size": 10,
"start_number": 1,
"bates_prefix": "CASE-001-"
}
}
)
numbered_url = response.json()["output_url"] Response in 285ms
{
"output_url": "https://files.xspdf.com/numbered.pdf",
"pages_processed": 47,
"format_applied": "Page {n} of {total}"
} Every Numbering Format You Need
From simple page numbers to complex Bates stamping, handle any pagination requirement programmatically.
Bates Numbering
Legal-compliant Bates stamping with custom prefixes, zero-padding, and sequential numbering across document sets. CASE-001-0001 format support.
Custom Positioning
Place numbers anywhere: top-left, bottom-center, custom X/Y coordinates. Set margins, rotation, and alignment. Perfect pixel-level control.
Typography Control
Choose font family, size, color, and weight. Match your brand or court requirements. Supports custom fonts and Unicode characters.
Page Range Support
Number only specific pages. Skip cover pages. Start numbering from page 3. Apply different formats to different ranges in one request.
Format Validation
API validates format strings before processing. Get instant feedback on invalid patterns. Preview mode shows how numbers will appear before applying.
Batch Processing
Process hundreds of documents with consistent numbering. Sequential Bates across files. Webhook notifications. Enterprise-grade throughput.
Frequently Asked Questions
Everything you need to know about page numbering APIs.
Can I use custom Bates numbering formats for legal discovery?
Yes. Use the bates_prefix parameter to add case identifiers like "CASE-001-" and set zero_padding to get CASE-001-0001 format. The API maintains sequential numbering across multiple documents and supports continuation from previous batches.
How do I skip page numbers on the cover page?
Set the start_page parameter to 2 to begin numbering on page 2. Or use page_ranges to specify exactly which pages should be numbered: "page_ranges": "2-50" will skip page 1 entirely. You can also use exclude_pages: [1] to skip specific pages.
Can I place page numbers at exact X/Y coordinates?
Yes. Use custom_position with x and y coordinates in points. For example: "custom_position": {"x": 72, "y": 720} places numbers 1 inch from the left and 10 inches from the bottom. Supports both absolute and percentage-based positioning.
What format strings are supported?
Use {n} for current page number and {total} for total pages. Examples: "Page {n} of {total}", "Page {n}", "{n}/{total}". Add custom text around these variables. For Bates, use bates_prefix separately: "CASE-001-" + zero-padded numbers.
How do I maintain sequential Bates numbering across multiple documents?
Use the continue_from parameter with the last Bates number from your previous document. The API returns next_start_number in the response so you can chain requests. For batch processing, use our batch endpoint which handles sequential numbering automatically.
Start Adding Page Numbers Today
Free tier includes 100 pages per month. No credit card required. Upgrade anytime as you scale.
Related APIs