7 Replies Latest reply on Jan 4, 2017 2:48 AM by Andreas Jansson

    How is APPLY_FRAME_FITTING_OPTIONS supposed to work?

    Andreas Jansson Level 2

      I don't understand how the FitOption called Apply_Frame_Fitting_Options is supposed to work. According to documentation it applies the current frame fitting options to the frame and content, but as I see it (using scripting) it doesn't.

      Is there anyone out there, who can explain?

       

      You can follow my tests below, step-by-step:

       

      1. Add a graphic frame to an empty document

      2. Right click the frame. In the pop-up menu select Fitting / Frame Fitting Options. In the dialogue box select "Fit content Proportionally" for the frame.

      3. Adjust the paths in the code below to two test images of your choice, with different proportions and sizes.

       

      app.activeDocument.pages[0].rectangles[0].place(File('/C//temp//test.jpg'));
      app.activeDocument.pages[0].rectangles[0].place(File('/C//temp//test2.jpg'));
      app.activeDocument.pages[0].rectangles[0].fit(FitOptions.APPLY_FRAME_FITTING_OPTIONS);
      

       

      The first image (test.jpg) will come out right, adapting its size proportionally within the frame.

      Calling the fit method with APPLY_FRAME_FITTING_OPTIONS (line 3) will however not change the fitting, and neither will changing the fitting manually from the Frame Fitting Options dialogue, unless you right click and select "Fitting / Clear Frame Fitting Options".

       

      Calling the fit method with a frameFittingOption explicitly set to PROPORTIONALLY or even read out from the frame (from the property called fittingOnEmptyFrame), works the way I would have expected from APPLY_FRAME_FITTING_OPTIONS.

       

      app.activeDocument.pages[0].rectangles[0].place(File('/C//temp//test.jpg'));
      app.activeDocument.pages[0].rectangles[0].place(File('/C//temp//test2.jpg'));
      app.activeDocument.pages[0].rectangles[0].fit(app.activeDocument.pages[0].rectangles[0].frameFittingOptions.fittingOnEmptyFrame);
      

       

      The documentation says:

      FitOptions.APPLY_FRAME_FITTING_OPTIONS

      Applies the current frame fitting options to the frame and content.

       

      So why didn't ...

      app.activeDocument.pages[0].rectangles[0].fit(FitOptions.APPLY_FRAME_FITTING_OPTIONS);
      

      ... re-apply the selected fittingOption?

       

       

      I hope there is someone who can explain what I'm doing wrong when applying APPLY_FRAME_FITTING_OPTIONS, and how it is meant to work.

       

      Best regards,

      Andreas Jansson

       

      The message was edited by: Andreas Jansson