Skip to main content
Inspiring
December 2, 2019
Answered

Export dimensions value to Excel sheet

  • December 2, 2019
  • 1 reply
  • 3538 views

Hi there, 

 

Is there a way, how to save page dimensions from combined PDF? 

For example: I want to calculate the area of a lot of plans, so I combined them and export the values of dimensions to an Excel sheet?

Is it possible? 

Thanks in advance.

David

This topic has been closed for replies.
Correct answer try67

mm


OK, then you can run this code from the JS Console (Ctrl+J, paste code into window, select all of it, press Ctrl+Enter) to get a print out of the dimensions in each page in your file. You can copy that print out and paste it directly into an Excel spreadsheet.

 

console.clear();
console.println("Page\tWidth\tHeight");
var mm = 2.83465;
for (var p=0; p<this.numPages; p++) {
	var aRect = this.getPageBox("Crop", p);
	var width = (aRect[2] - aRect[0])/mm;
	var height = (aRect[1] - aRect[3])/mm;
	console.println((p+1) + "\t" + width + "\t" + height);
}

 

 

 

1 reply

try67
Community Expert
Community Expert
December 2, 2019

You can use a script to generate a list of all the page sizes in a document, if that's what you mean.

However, each page in a PDF file is defined by multiple boxes (Crop, Trim, Art, Media, Bleed), so you need to decide which of those boxes you want to use for your calculations.

Inspiring
December 2, 2019

Thanks for Your time. Can You give me some advice where to start. I would like to use the cop-box data to calculate the whole area. 

try67
Community Expert
Community Expert
December 2, 2019

What units do you want the output to be in (inch/mm/cm/points/etc.)?