Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 80307

Re: Checking Trim size Quickly

$
0
0

Building upon this great topic thread, here is code for showing all 5 page boxes, displayed in metric and rounded to 2 decimal places (the rounding is not always perfect, which I believe is a limitation in this method of rounding).

 

function ThePageSize(){
var aRect = this.getPageBox("Crop");
var aWidth = aRect[2] - aRect[0];
var aHeight = aRect[1] - aRect[3];
var bRect = this.getPageBox("Art");
var bWidth = bRect[2] - bRect[0];
var bHeight = bRect[1] - bRect[3];
var cRect = this.getPageBox("Trim");
var cWidth = cRect[2] - cRect[0];
var cHeight = cRect[1] - cRect[3];
var dRect = this.getPageBox("Bleed");
var dWidth = dRect[2] - dRect[0];
var dHeight = dRect[1] - dRect[3];
var eRect = this.getPageBox("Media");
var eWidth = eRect[2] - eRect[0];
var eHeight = eRect[1] - eRect[3];
app.alert("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: "File", cExec: "ThePageSize()" });

 

 

Here is an example of the CropBox data displayed in Acrobat Pro vs. Acrobat Reader, where the script is showing incorrect rounding:

 

pageboxes.png


Viewing all articles
Browse latest Browse all 80307

Trending Articles