Quantcast
Channel: Adobe Community: Message List - InDesign Scripting
Viewing all articles
Browse latest Browse all 37788

How to get exact values.

$
0
0

Hi Forum,

 

I'm trying to get page margin Width and Height as a text in slug area.

 

When I minus the pagewidh with pagemargin, i'm getting values in fractions like this.

 

eg. 177.43999999.

 

 

When i draw a rectangle box to check the width and Height, the measurement pallet show exactly like this.... 177.44

 

How can i get exact values as i see in measurement pallette...

 

 

var myTextFrame = myDocument.textFrames.add();

with (myDocument.pages.item(0).marginPreferences){

              //Save the current application default margin preferences.

    var myY1 = top;

              var myX1 = left;

              var myY2 = bottom;

              var myX2 = right;

              //Set the application default margin preferences.

              var mWidth = parseFloat(myPageWidth - myX1 - myX2);

        var mHeight =  parseFloat(myPageHeight - myY2 - myY1);

   

  

          myTextFrame.contents = "Ratio: y = 1.75x – Artwork Final size = (H)" + myPageHeight + "mm x (W)" + myPageWidth +"mm  Artwork set at 25% of final size=(H)2410mm x (W)1370mm  Live area = (H)" + mHeight+ "mm x (W)" + mWidth+ "mm ";

          }

 

thanks in advance for the help..

 

 

thanks.


Viewing all articles
Browse latest Browse all 37788

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>