Reply To: How to resize Graphic to specific inches ?

#90603
Kathy Cote
Member

Hi,
ok to do fit image depending on the width of the document.

And now if I want the picture fit height of the Height size?

I cannot use: app.selection[0].fit ( FitOptions.PROPORTIONALLY );
Because it adjusts the image to be fully visible in the frame.
If I use a fit proportionally in height, the image may be wider than the Frame and it’s ok. It’s what I want.

///////////

var PHeight = myDocument.documentPreferences.pageHeight;
var myHeight = parseFloat(PHeight);
var FinalHeight = myHeight + “in”;
alert (FinalHeight);
var h = new UnitValue(FinalHeight).as(“pt”);

//How to do not have the value w? I want a fit Height and not width. Width is forced to be there?
myGraphic.resize(CoordinateSpaces.INNER_COORDINATES,AnchorPoint.TOP_CENTER_ANCHOR,ResizeMethods.REPLACING_CURRENT_DIMENSIONS_WITH,[w,h,ResizeConstraints.KEEP_CURRENT_PROPORTIONS])

This article was last modified on December 19, 2016

Comments (0)

Loading comments...