4 Replies Latest reply on Dec 27, 2011 7:23 AM by siva prasath

    frameFittingOption

    Pooja_IDDev Level 1

      How to get a value of frameFittingOptions applied to graphicFrame?

       

      Thanx in advance

        • 1. Re: frameFittingOption
          Green4ever Level 3

          Can you give some more information, what you need exactly? This seems meaning less for me....

          • 2. Re: frameFittingOption
            [Jongware] Most Valuable Participant

            What 'value' exactly?

             

            See http://jongware.mit.edu/idcsjs5.5/pc_Rectangle.html#frameFittingOptions -- each Frame Fitting Options object has lots of properties.

             

            (Note that I used "rectangle" to refer to the options. InDesign doesn't have a 'graphicFrame' object, method, or property anywhere.)

            • 3. Re: frameFittingOption
              Pooja_IDDev Level 1

              I have drawn Rectangle Tool Frame on Indesign CS5.5 and placed image into it...now suppose i have set fitting option to Fit content Proportionally or Fit Content to Frame, now i want get these values in my java script program, so how do i get it.

              • 4. Re: frameFittingOption
                siva prasath Level 1

                In your question asking about how much the figure it’s reduced or enlarge

                 

                Use the below script it will create one excel file in same file path in this you can find how much the image is scaled and Resolution of the image.

                 

                 

                var myDocument=app.activeDocument;
                var myFilePath=document.filePath;
                var myFileName=document.name;
                if(myFileName.indexOf(".indd")!=-1)
                {
                var myRegularExpression = /.indd/gi
                myFileName2 = myFileName.replace(myRegularExpression, ".xls");
                }
                //wri("Hai");
                var links = myDocument.links;
                //var res=links.actualPpi;
                //alert(links.length);
                imageSize();
                //imageType()
                
                function imageSize()
                {
                  var myDocument=app.activeDocument;
                  var myFileName1=document.name;
                  var myFilePath4=myDocument.filePath + "/" +  myFileName2
                  var mytxtFile = new File(myFilePath4);
                  mytxtFile.open("w");
                  
                  
                  var links = myDocument.links;
                  
                  if (links.length == 0) 
                  {mytxtFile.write("No Images\r\r");}
                  else
                  {
                  mytxtFile.write(myFileName+"\n\n");
                  mytxtFile.write("Image Name\tRaster/ Vector\tHori Size\tVer Size\t Image Resolution\t Effective Resolution\n\n");
                  
                  for (var i = 0; i < links.length; i++) 
                  {
                   var image = links[i].parent;
                   
                   //var res=image.properties.actualPpi;
                   //var eff=image.properties.effectivePpi;
                   var b = image.itemLink.name;
                   var a = b.split(".");   
                   //alert(a[1]);
                   if((a[1] == 'jpg') || (a[1] == 'jpeg') || (a[1] == 'bmp') || (a[1] == 'tif') || (a[1] == 'tiff') || (a[1] == 'gif') || (a[1] == 'giff') || (a[1] == 'png') )
                  {
                   //a[1] = a[1].replace("saj")
                   a[1]="Raster";
                   var res=image.properties.actualPpi + " ppi";
                   var eff1=image.properties.effectivePpi;
                   var eff=image.properties.effectivePpi + " ppi";
                   
                   
                   //alert(a[1]);
                   }
                   else if((a[1] == 'eps') || (a[1] == 'svg') || (a[1] == 'ai') || (a[1] == 'pdf'))
                   {
                   a[1]="Vector";
                   var res="undefined";
                   var eff="undefined";
                   var ok= "Not Applicable";
                    }
                    
                   mytxtFile.write(image.itemLink.name + "\t"+a[1]+"\t"+ Math.round(image.absoluteHorizontalScale) +"%" +"\t"+ Math.round(image.absoluteVerticalScale) +"%"+"\t"+ res+"\t"+ eff +" \n\n");
                      }
                  
                  }
                 alert ("Report Generated");
                }