How to Add a Filename or Invoice Number to Every PDF Page
Question details
The user needs a consistent invoice number or the current PDF filename to be displayed across all pages of an invoice document.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Formatting an invoice document to display consistent tracking information on multiple pages.
- Observed behavior
- The invoice document requires the invoice number (e.g., FAF200001) or a dynamically updated file name to appear on every page for easier tracking and organization.
Determine whether the text you want to add is static (like a fixed invoice number) or dynamic (like a filename that updates automatically when renamed), as these two requirements dictate completely different methods.
Use the Header & Footer Tool for Fixed Text
This method is the standard, easiest approach for adding a static invoice number or document title across all pages of your PDF simultaneously.
Open your document in Adobe Acrobat, navigate to the 'Edit PDF' tool on the right-hand pane, and select 'Header & Footer' > 'Add' from the top toolbar.
Click into the desired placement box (e.g., Left Header, Center Footer) and type your specific invoice number (e.g., FAF200001).
Ensure the 'Page Range Options' are configured to include all the pages you want stamped, check the visual preview, and click 'OK' to save your changes.

Use Custom JavaScript for Dynamic Filenames
If you need the printed text to automatically update whenever the PDF file is renamed, you cannot use built-in tools. You must use a form field populated by a document-level script.
Add Invoice Numbers to PDF Pages Quickly with WPS PDF
WPS PDF provides a user-friendly Header and Footer feature that lets you effortlessly stamp invoice numbers, dates, or custom text across all pages in your PDF document without needing advanced technical knowledge.
- 1. Open PDF in WPS Office: Launch WPS Office on your computer and open the target invoice PDF document.
- 2. Access the Header and Footer tool: Navigate to the 'Insert' tab on the top ribbon menu and click on the 'Header and Footer' button.
- 3. Enter the invoice number: Type your invoice number (e.g., FAF200001) into the appropriate header or footer text box.
- 4. Apply to pages: Select 'All Pages' in the page range settings to ensure uniformity, and click 'OK' to apply the invoice number to the entire document.

Frequently Asked Questions
Why doesn't the filename in my PDF header update when I rename the file on my computer?
Standard PDF header and footer tools insert your filename as static text. When you rename the file in your operating system later, the header text remains exactly what it was when you inserted it. To make it update automatically, you must use a dynamic form field paired with custom JavaScript instead.
Can I add the invoice number to only specific pages of my PDF?
Yes. When using the Header and Footer tool in either Adobe Acrobat or WPS PDF, you can click on 'Page Range Options' and specify exactly which pages (for example, pages 2 to 5) should display the invoice number.
Will the JavaScript method for dynamic filenames work if I send the PDF to a client?
Not necessarily. Document-level JavaScripts rely heavily on the recipient's PDF reader capabilities and security settings. If your client uses a basic PDF viewer, a mobile browser, or has strict Adobe Reader security settings enabled, the script may be blocked from reading the filename, leaving the field blank or outdated.




