How to Number Front and Back PDF Pages with Matching Numbers
Question details
The user wants to assign matching page numbers to the front and back pages of a two-sided PDF document intended for duplex printing.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Preparing a two-sided PDF document for duplex printing where each physical sheet needs a matching number for its front and back sides.
- Observed behavior
- Standard PDF editors do not offer a built-in numbering pattern for matching front and back page numbers (e.g., 1 Front, 1 Back).
Ensure your PDF document is finalized in terms of page order and content before applying custom page labels or scripts, as adding or removing pages later will disrupt the numbering sequence.
Use a Custom JavaScript in Adobe Acrobat
Since Acrobat lacks a built-in feature for this specific numbering style, running a custom JavaScript is the most effective way to label pages as '1 Front', '1 Back', etc.
Adobe Acrobat allows users to execute custom JavaScript via the Action Wizard or the JavaScript console to manipulate page labels programmatically.
Open your PDF in Adobe Acrobat. Press 'Ctrl + J' (Windows) or 'Cmd + J' (Mac) to open the JavaScript Debugger console.
In the console, write or paste a script that loops through the pages. The script should calculate the sheet number by dividing the page index by 2, and append 'Front' for even indexes and 'Back' for odd indexes.
Highlight the script code in the console and press 'Ctrl + Enter' (Windows) or 'Cmd + Enter' (Mac) to run it. The page labels in the thumbnail pane will update to reflect the new matching numbers.

Manually Edit Page Labels
If your document only has a few pages, you can manually change the page labels without needing to write code.
Add Custom Page Numbers with WPS PDF
WPS PDF provides a user-friendly interface to insert and customize page numbers. You can use the Header and Footer tool to apply specific numbering formats to odd and even pages separately, making it easier to set up documents for duplex printing.
- 1. Open PDF in WPS Office: Launch WPS Office and open your PDF document using the WPS PDF tool.
- 2. Access Header and Footer: Navigate to the 'Insert' tab and click on 'Header and Footer', then select 'Add Header and Footer'.
- 3. Configure Odd Pages (Front): In the settings dialog, set your custom text (e.g., 'Front') alongside the page number macro. Under 'Page Range Options', select 'Odd pages only' and apply.
- 4. Configure Even Pages (Back): Repeat the process by adding a new Header/Footer. This time, use the text 'Back' with the page number macro, and select 'Even pages only' in the Page Range Options.

Frequently Asked Questions
Can I print front and back page numbers using standard printer settings?
Standard printer settings only control how the document is physically printed (e.g., duplex or simplex). They do not alter the actual page numbers or labels displayed on the document pages. You must add the numbers to the PDF before printing.
Is there a way to automatically number pages as 1A, 1B, 2A, 2B?
Similar to the 'Front' and 'Back' labeling, standard PDF editors do not have a built-in 1A/1B sequence. You would need to use a custom JavaScript or manually edit the page labels in the thumbnail panel.
Will custom page labels show up when the PDF is printed?
Page labels (which appear in the PDF viewer's navigation bar) do not automatically print on the physical page. To print the numbers, you must insert them as Headers and Footers or Bates Numbering directly onto the document pages.




