How to Automatically Trim Odd and Even PDF Pages in Acrobat
Question details
The user needs a method to remove the center spine from a PDF document by applying different crop adjustments to odd and even pages.

- Product
- Adobe Acrobat Pro
- Device & OS
- not provided
- Scenario
- Editing a scanned or bound PDF where the center spine needs to be consistently removed across all pages, requiring alternating margin trims.
- Observed behavior
- The goal is to successfully trim the left edge of odd-numbered pages and the right edge of even-numbered pages without manually cropping each page.
Before applying bulk crop scripts or settings, ensure you are working on a duplicate copy of your PDF file to avoid permanently altering or losing your original document.
Use Acrobat JavaScript to Auto-Trim Alternating Pages
Run a custom JavaScript code in Acrobat Pro to automatically adjust the crop box based on whether the page is odd or even.
This method utilizes Acrobat's JavaScript Console to apply a programmatic crop. The script determines if a page is odd or even and applies the trim to the correct side.
Use the following code. The variable 'nTrim = 72' equals one inch. Adjust '72' to match your spine width in points: var nTrim = 72; for (var i = 0; i < this.numPages; i++) { var aBox = this.getPageBox('Crop', i); if (i & 1) aBox[0] += nTrim; else aBox[2] -= nTrim; this.setPageBoxes('Crop', i, i, aBox); }
In Adobe Acrobat Pro, press Ctrl+J (Windows) or Cmd+J (Mac) to open the JavaScript Debugger console.
Clear any existing code in the console window, then paste the provided JavaScript code into the input area.
Modify the 'nTrim = 72' value in the script to reflect the exact number of points you need to trim from the spine.
Highlight the code and press Ctrl+Enter (Windows) or Cmd+Enter (Mac) to execute the script and apply the crop to all alternating pages.

Apply Crop Settings Manually via Crop Pages Tool
Use the built-in Crop Pages dialog to apply margin controls separately to odd and even pages.
Crop PDF Pages Easily with WPS Office
WPS Office provides an intuitive PDF Editor that allows you to effortlessly crop pages, remove unwanted margins, and specify alternating page ranges without needing to write or execute complex JavaScript code.
- 1. Open Your PDF: Launch WPS Office and open the PDF file containing the spine you want to remove.
- 2. Access Page Cropping: Navigate to the 'Edit' tab and click on the 'Crop Page' tool to open the cropping configuration window.
- 3. Set the Crop Area: Drag the margins or manually input the trim dimensions to exclude the center spine.
- 4. Apply to Specific Pages: In the Page Range settings, simply select 'Odd Pages' or 'Even Pages' to apply your specific margin adjustments, then repeat for the opposite side.
- 5. Save the Document: Click 'OK' to apply the crop, then save your perfectly aligned PDF document.

Frequently Asked Questions
What does the value '72' represent in the JavaScript crop code?
In Adobe Acrobat JavaScript, measurements are calculated in points. The value '72' represents exactly 72 points, which is equal to one inch. You can increase or decrease this number to adjust the width of the crop.
Can I undo the script after cropping the PDF pages?
If you have not yet saved and closed the document, you can undo the action using Ctrl+Z (Windows) or Cmd+Z (Mac). However, once saved, the crop is usually permanent. Always test scripts on a backup file.
Why does the spine appear on different sides for odd and even pages?
When a bound document (like a physical book) is scanned as single pages, the center binding (spine) naturally lands on the left edge for right-hand pages (typically odd) and on the right edge for left-hand pages (typically even).




