Every wanted to quickly see the page size of your PDF file?.

This little javascript will display the crop size, trim size, bleed size and media box size within a PDF file.

Once installed you will check another option under the “View” Menu called “Show PageBox Sizes”

If you open a PDF file and select this menu it will display the Page Box info.

 

How to Install

Copy this code into a text editor and save as a .js file

function ThePageSize(){  
var aRect = this.getPageBox(“Crop”,this.pageNum);  
var aWidth = aRect[2] – aRect[0];  
var aHeight = aRect[1] – aRect[3];  
var bRect = this.getPageBox(“Art”,this.pageNum);  
var bWidth = bRect[2] – bRect[0];  
var bHeight = bRect[1] – bRect[3];  
var cRect = this.getPageBox(“Trim”,this.pageNum);  
var cWidth = cRect[2] – cRect[0];  
var cHeight = cRect[1] – cRect[3];  
var dRect = this.getPageBox(“Bleed”,this.pageNum);  
var dWidth = dRect[2] – dRect[0];  
var dHeight = dRect[1] – dRect[3];  
var eRect = this.getPageBox(“Media”,this.pageNum);  
var eWidth = eRect[2] – eRect[0];  
var eHeight = eRect[1] – eRect[3];  
var pageLabel = this.pageNum + 1;  
var totalPages = this.numPages;  
app.alert(“Page: “ + pageLabel + “ of “ + totalPages + “ pages” + “\n\n” + (“Crop: “ + Math.round(aWidth*0.3528*100)/100 + “ mm x “ + Math.round(aHeight*0.3528*100)/100 + “ mm” + “\n\n” + (“Art: “ + Math.round(bWidth*0.3528*100)/100 + “ mm x “ + Math.round(bHeight*0.3528*100)/100 + “ mm”) + “\n\n” + (“Trim: “ + Math.round(cWidth*0.3528*100)/100 + “ mm x “ + Math.round(cHeight*0.3528*100)/100 + “ mm”) + “\n\n” + (“Bleed: “ + Math.round(dWidth*0.3528*100)/100 + “ mm x “ + Math.round(dHeight*0.3528*100)/100 + “ mm”) + “\n\n” + (“Media: “ + Math.round(eWidth*0.3528*100)/100 + “ mm x “ + Math.round(eHeight*0.3528*100)/100 + “ mm”)  
));  
 
app.addMenuItem ({cName: “Show PageBox Sizes”, cParent: “View”, cExec: “ThePageSize()” }); 

Copy the file to the following location

On Windows

C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\Javascripts\

On a Mac

/Applications/Adobe Acrobat DC/Adobe Acrobat.app/Contents/Resources/Javascripts/

Leave a Reply

Your email address will not be published. Required fields are marked *