Quantcast
Channel: Adobe Community : Discussion List - Illustrator Scripting
Viewing all articles
Browse latest Browse all 3671

Resize Groupitems using Javascript

$
0
0

below is the code iam using to resize the width to 100px, but it resized to 101px/99px. (due to Percentage value)

 

Please suggest to resize appropriately 100px width

 

var objectBounds = docRef.visibleBounds;

var W = objectBounds[2] - objectBounds[0];    // figures the width

var H = objectBounds[1] - objectBounds[3];     // figures the height

 

var ReziseWidth=100;

var percentageX = Math.round((ReziseWidth / W) * 100);

 

var percentageY = percentageX;

app.executeMenuCommand ("selectall")

app.executeMenuCommand ("group")

docRef.groupItems[0].resize(percentageX, percentageY);


Viewing all articles
Browse latest Browse all 3671


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