variable

Post Reply
kmcrae
Member
Posts: 23
Joined: Wed Feb 23, 2011 2:49 am

variable

Post by kmcrae »

Hi,



the variable [Stats.PageHeight] the result is in "point" size i want the result in "inch" size?
Harald Mahrer
Newbie
Posts: 2
Joined: Tue Aug 16, 2011 6:21 pm

variable

Post by Harald Mahrer »

Hi,



as I'm from Austria I don't know the conversition factor from points to inches, but I got a small script-expressions from rzacherl which helped me to convert from points to millimeters. This should work for You if you just change the "0.35277" to your conversion factor and the Stats.MediaBoxWidth to the Stat You like to approach. You can skip the + " mm" in the end, if you do not want to attached the unit. You copy and paste the lines below to the "scripted expressions" editor where You need it (eg for the standard value of metadata field)





function convert() {

var MBpt = job.getVariableAsNumber( "[Stats.MediaBoxWidth]" );

var MBmm = Math.round( MBpt * 0.35277 ).toString();

return MBmm + " mm"

}

convert();



I hope You can use this.



Best regards from Vienna.
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

variable

Post by dkelly »

The conversion points to inches is 1/72 or 0.0138888889





function convert() {

var MBpt = job.getVariableAsNumber( "[Stats.MediaBoxWidth]" );

var MBin = Math.round( MBpt * 0.0138888889 ).toString();

return MBin + " in"

}

convert();





Dwight Kelly

Apago, Inc.

dkelly@apago.com
Post Reply