PDF Editing Issues

How to Generate Sequential Job Numbers in a PDF Form

Khadija KhanKhadija Khan Nov 2, 2026 868 views

Question details

The user wants to automatically generate and assign unique sequential job numbers every time a PDF form is opened.

How to Generate Sequential Job Numbers in a PDF Form
Product
PDF / Adobe Acrobat
Device & OS
not provided
Scenario
Creating automated tracking documents such as invoices, work orders, or job tickets where a unique, incrementing number is required upon opening the form.
Observed behavior
Local JavaScript variables increment properly on a single computer, but fail to provide reliable sequential numbering when the form is accessed across multiple computers or by simultaneous users.
Before you start

Determine if the PDF form will be used strictly by a single user on one computer, or shared across a network by multiple users, as this completely dictates whether you need a local script or a networked database.

Solution 1Recommended

Use Document-Level JavaScript for Single-User Workflows

Implement a persistent global variable using document-level JavaScript to automatically increment a job number field when the document is opened on a single computer.

Acrobat global objects can store persistent values locally on the machine. This is ideal for a single-user environment where the form is always processed from the same computer.

1
Open PDF JavaScript Tools

Open your PDF form in your advanced PDF editor and navigate to the document-level JavaScript tools.

2
Create the Target Field

Add a text field to your form where the job number should appear and name it exactly 'jobCount'.

3
Add Initialization Script

Create a new document-level script and enter the following logic: if (global.count == null) { global.count = 1000000; global.setPersistent('count', true); } else { global.count++; } this.getField('jobCount').value = global.count;

4
Save and Test

Save the document and reopen it. The number will automatically increment from the starting value each time the file is opened.

Use Document-Level JavaScript for Single-User Workflows
Resetting the Counter: You can add a reset button to your form with a short script that assigns a new starting value to the global.count variable to restart the sequence.
Complete PDF Form Solution

Create and Manage PDF Forms Seamlessly with WPS Office

WPS Office provides a comprehensive PDF editor that allows you to design forms, add text fields, and manage document properties with ease. It's a lightweight, all-in-one solution for your daily document and PDF workflows.

  1. 1. Open WPS Office: Launch WPS Office and navigate to the PDF tool section.
  2. 2. Load or Create a PDF: Open your existing PDF document or create a new blank PDF to serve as your form.
  3. 3. Access Form Tools: Go to the 'Form' tab on the ribbon to access interactive tools like text boxes, check boxes, and buttons.
  4. 4. Insert and Name Fields: Place a text field where you want the sequential number to appear and rename its properties to 'jobCount'.
  5. 5. Save and Distribute: Save your interactive PDF form to securely share with your team or clients.
Easily insert, edit, and manage interactive PDF form fields.Fully compatible with standard PDF formats created in Adobe Acrobat and Microsoft Office.Lightweight software with a user-friendly, familiar interface.All-in-one suite covering PDF, Word, Excel, and Presentation tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my PDF numbering script generate duplicate numbers on different computers?

Global variables in PDF JavaScript (like global.count) are saved locally on the hard drive of the specific computer. They do not sync automatically over a network, meaning two users opening the form will generate numbers independently based on their own local counter.

Can I use JavaScript sequential numbering on mobile PDF readers?

Most mobile PDF readers do not support advanced document-level JavaScript or persistent global variables. A server-based numbering solution is highly recommended for forms accessed on mobile devices.

How do I reset the sequential job number back to its starting value?

You can create a form button and assign a custom JavaScript action to it. The script should assign a new value to the global variable (e.g., global.count = 1000000;) and then update the target text field.

Do I need expensive database software to set up a multi-user numbering system?

Not necessarily. You can use free or open-source database solutions like MySQL or PostgreSQL combined with a lightweight web script to issue unique numbers to your PDF form via HTTP requests.