How to Add Centered Text to a PDF Using Acrobat Action Wizard
Question details
The user needs a method to automatically append a blank first page to a PDF and place centered text on it using Adobe Acrobat's Action Wizard.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Automating bulk PDF modifications to insert a standardized cover page or title text.
- Observed behavior
- The goal is to automatically execute a script that creates a new page and applies formatted text via the addWatermarkFromText function.
Ensure you are using Adobe Acrobat Pro, as the Action Wizard and custom JavaScript execution features are not available in the free Adobe Acrobat Reader version.
Use Execute JavaScript in Action Wizard
Create a custom Action Wizard sequence that runs a JavaScript command to add a new page and apply text as a watermark.
By utilizing Acrobat's built-in JavaScript API, you can automate structural changes like adding pages and overlaying content. The addWatermarkFromText method is ideal for placing centered text precisely where you need it.
Launch Adobe Acrobat Pro, go to the 'Tools' tab, and select 'Action Wizard' to open the automation panel.
Click on 'New Action' from the top toolbar to build a new sequence of tasks.
In the left pane under 'Choose tools to add', expand the 'More Tools' section. Select 'Execute JavaScript' and click the '+' button to add it to your action steps on the right.
Uncheck the 'Prompt User' checkbox so the script runs automatically. Then, click 'Specify Settings' to open the JavaScript editor.
Paste the following code into the editor: this.newPage(-1); this.addWatermarkFromText({nStart: 0, cText: "TEST"});. Click 'OK' to save the script.
Click 'Save', name your Action, and run it on your desired PDF files. The script will insert a blank page at the beginning and stamp the text "TEST" on it.

Add Blank Pages and Text Easily with WPS PDF
If you prefer an intuitive visual interface over writing JavaScript code, WPS Office allows you to quickly insert blank pages, add centered text boxes, and apply custom watermarks to your PDFs in just a few clicks.
- 1. Open the PDF File: Launch WPS Office and open your PDF document within the WPS PDF viewer.
- 2. Insert a Blank Page: Navigate to the 'Page' tab on the top ribbon and select 'Insert Blank Page' to instantly add a new page at the start of your document.
- 3. Add Centered Text: Go to the 'Insert' tab, click on 'Text Box', place it on the newly created blank page, type your text, and use the alignment tools to center it horizontally and vertically.
- 4. Save the Changes: Click the 'Save' icon or press Ctrl+S to securely save the changes directly to your PDF document.

Frequently Asked Questions
Can I run this Action Wizard script on multiple PDF files at once?
Yes. When setting up the Action in Acrobat Pro, you can select 'Add Folder' or 'Add Files' under the Files to be Processed section. The JavaScript will automatically add the blank page and centered text to all selected files in a batch.
Why does the newPage command use '-1'?
In Adobe's JavaScript API, passing '-1' to the this.newPage() method instructs Acrobat to insert the new blank page before the very first page of the current document.
Can I use this method in the free Adobe Reader?
No. The Action Wizard and the ability to execute document-level JavaScript for adding pages and watermarks are premium features exclusive to Adobe Acrobat Pro.
How do I change the font size in the JavaScript?
You can customize the text size by adding the nFontSize property to your script. For example: this.addWatermarkFromText({nStart: 0, cText: "TEST", nFontSize: 24});.




