Other PDF Issues

Export PDF Page Dimensions to Excel Using Acrobat JavaScript

Adam DavisAdam Davis Nov 2, 2026 869 views

Question details

The user needs to extract the width and height of every page in a combined PDF document and copy this dimensional data into an Excel spreadsheet.

How to Export PDF Page Dimensions to Excel Using Acrobat JavaScript
Product
Adobe Acrobat, Microsoft Excel
Device & OS
not provided
Scenario
Auditing or preparing documents where a precise, spreadsheet-friendly list of PDF page sizes (such as Crop, Trim, or Media box dimensions) is required.
Observed behavior
The user aims to generate a structured output using the Acrobat JavaScript Console that tabulates page numbers, widths, and heights for easy pasting into Excel.
Before you start

Before running any scripts, determine which PDF page boundary you need to measure. A PDF contains multiple defined boxes (Crop, Trim, Media, Art, and Bleed), and your script must target the correct box for accurate calculations.

Solution 1Recommended

Use the Acrobat JavaScript Console to Output Dimensions

Execute a custom script in the Acrobat JavaScript Console to retrieve page properties and generate tab-separated values that paste perfectly into Excel.

PDF page dimensions are natively stored in points (1/72 of an inch). To get measurements in millimeters or inches, your script must perform a conversion. Using tab characters (\t) in your script's output ensures that Excel automatically splits the data into distinct columns.

1
Open the JavaScript Console

Launch Adobe Acrobat, open your combined PDF document, and press Ctrl+J (Windows) or Cmd+J (Mac) to open the JavaScript Debugger Console.

2
Write or Paste the Extraction Script

Input a JavaScript loop that iterates through all pages (`this.numPages`). For each page, retrieve the dimensions of the desired box (e.g., `this.getPageBox("Crop", i)`).

3
Format for Spreadsheet Compatibility

Ensure your script concatenates the page number, width, and height variables separated by the `\t` string. Use `console.println()` to print each page's data on a new line.

4
Run the Script

Highlight all the code you just pasted into the console and press Ctrl+Enter (or Enter on the numeric keypad) to execute the script and generate the output.

5
Copy and Paste into Excel

Select the newly generated text in the console, copy it, open a blank Microsoft Excel workbook, and paste the values. They should automatically align into separate columns.

Use the Acrobat JavaScript Console to Output Dimensions
Proper Alignment: If the data does not separate into columns when pasting, you can use Excel's 'Text to Columns' feature under the Data tab to split the text by spaces or commas.
Free Microsoft Office alternative

Easily Manage PDFs and Spreadsheets with WPS Office

While running custom JavaScript requires premium Adobe subscriptions, WPS Office offers a completely free, lightweight alternative. Featuring an integrated PDF editor and a powerful Spreadsheet tool, WPS Office lets you view PDF properties, convert PDF tables to Excel instantly, and seamlessly manage all your data in one familiar, easy-to-use application.

  1. 1. Download and Install: Download WPS Office for free from the official website and install the suite on your device.
  2. 2. Open WPS PDF: Open your PDF documents directly within WPS to view page properties or use built-in extraction tools.
  3. 3. Convert or Edit: Use the integrated PDF to Excel conversion feature to automatically extract data directly into WPS Spreadsheet without using code.
100% format compatibility with Microsoft Excel (.xlsx) and standard PDF files.Built-in PDF to Spreadsheet conversion tools that bypass complex coding requirements.Lightweight, fast-loading interface suitable for Windows, Mac, Linux, and mobile devices.Completely free basic features, offering a seamless migration from expensive office suites.
microsoft office alternative - wps office

Frequently Asked Questions

What is the difference between CropBox and MediaBox in a PDF?

The MediaBox defines the physical physical dimensions of the page medium (such as A4 or Letter paper size). The CropBox defines the visible region of the page that is displayed or printed, after any margins or cropping have been applied.

Are PDF dimensions measured in inches by default?

No. Internally, PDF page dimensions are measured in points, where 72 points equal 1 inch. To export the dimensions in inches or millimeters, your JavaScript must divide the point value by 72 and multiply by the appropriate conversion factor.

Can I run Acrobat JavaScript without an Adobe Acrobat Pro subscription?

Generally, running custom page-level extraction scripts via the JavaScript Debugger Console requires Adobe Acrobat Standard or Pro. Basic free PDF readers do not typically support executing document-level JavaScript via a console.

Why is my copied console output appearing in a single column in Excel?

This happens when the script outputs spaces instead of tab characters. To fix this, edit your script to separate the values with a tab character (\t). Alternatively, you can paste the text into Excel and use the 'Text to Columns' feature to split the data.