How to Generate Sequential Job Numbers in a PDF Form
Question details
The user wants to automatically generate and assign unique sequential job numbers every time a PDF form is opened.

- 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.
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.
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.
Open your PDF form in your advanced PDF editor and navigate to the document-level JavaScript tools.
Add a text field to your form where the job number should appear and name it exactly 'jobCount'.
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;
Save the document and reopen it. The number will automatically increment from the starting value each time the file is opened.

Implement a Server-Side Database for Multi-User Workflows
Use a central database or web service to coordinate numbering across a network, ensuring no duplicates are generated by multiple users.
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. Open WPS Office: Launch WPS Office and navigate to the PDF tool section.
- 2. Load or Create a PDF: Open your existing PDF document or create a new blank PDF to serve as your form.
- 3. Access Form Tools: Go to the 'Form' tab on the ribbon to access interactive tools like text boxes, check boxes, and buttons.
- 4. Insert and Name Fields: Place a text field where you want the sequential number to appear and rename its properties to 'jobCount'.
- 5. Save and Distribute: Save your interactive PDF form to securely share with your team or clients.

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.




