3 Replies Latest reply on Jan 20, 2016 12:46 PM by davidr83890448

    image border

    davidr83890448

      All of the images that appear in InDesign imported from my IDML have a border that my client wants removed.

       

      IDML_Image_Border.JPG

      What is the attribute to remove these borders?

       

      Thanks!

        • 1. Re: image border
          Laubender Adobe Community Professional & MVP

          Hi David,

          if the placed images itself have a border, that could be removed only in an application like PhotoShop or Adobe Illustrator (if vector graphics).

          If the "border" is done in InDesign, you can set the strokeWeight of the rectangles holding the images to value 0 .

           

          See:

          Adobe InDesign CS6 (8.0) Object Model JS: Rectangle

           

          This could be done, if you can identify the rectangles on the page by whatever means (or a selection by the user).

          Here an example with one rectangle selected:

           

          app.selection[0].strokeWeight = 0;
          

           

          Or it could be done, if you identify the links (if the images are linked) and work on the parent of the parent of a link.

          Also read the comments in the snippet:

           

          var doc = app.documents[0];
          var links = doc.links.everyItem().getElements();
          
          // loop through the links array:
          
          for(var n=0; n<links.length; n++)
          {
              
              // If there are text files placed, the parent of a link will be a Story object.
              // We have to avoid these:
              
              if(links[n].parent.constructor.name == "Story"){continue};
              
              // To refine the search, you could look at e.g. placed JPEG files only:
              
              if(links[n].parent.imageTypeName == "JPEG")
              {
                  links[n].parent.parent.strokeWeight = 0;
              };
          
              // For PhotoShop images use "Photoshop"
              // For PNG files use "PNG"
              // For PDF or Adobe Illustrator graphics use "Adobe PDF"
              
              // Find out your placed image type names yourself.
              // This will write the image type name to the JavaScript console 
              // of the ESTK (ExtendScript Toolkit:
              
              $.writeln(n+"\t"+links[n].parent.imageTypeName);
          
          }
          

           

          A different method could be to work with the allGraphics array of the document or the page.

          Here an example, that sets the strokeWeight of all containers (graphic frames) for the graphics on page 1 of the active document to 0 :

           

          var allGraphicsOnPageOne = app.documents[0].pages[0].allGraphics;
          
          for(var n=0; n<allGraphicsOnPageOne.length;n++)
          {
               allGraphicsOnPageOne[n].parent.strokeWeight = 0;
          };
          

           

          Uwe

          • 2. Re: image border
            Vamitul Level 4

            From your question i'm guessing you are trying to modify the idml directly.
            For that, you need to identify the image's parent rectangle and make sure you set the StrokeWeight attribute to 0. You can also change the StrokeColor attribute to point to the "None" swatch, as it is defined in the Graphics.xml file inside the package.

             

            <Rectangle Self="blah_Blah" StrokeWeight="0" StrokeColor="Swatch/None">

            • 3. Re: image border
              davidr83890448 Level 1

              StrokeWeight="0"


              Works great!


              THANKS!!!