3 Replies Latest reply on Jan 19, 2011 12:03 AM by Kasyan Servetsky

    InDesign XML Import: Wrap text around inline images?





      I'm importing some custom made XML into InDesign that inlcudes photo, name, title, and bio elements. So far I'm able to successfully import and make use of multiple text-only element sets, and apply styles to tags for an impressive document. I'm also able to import images to show inline just fine.


      Formatting images however has been a challenge. I hope to wrap text to the right of the image. Is there some way to apply tags to object styles, or some other way to make my inline images wrap nicer with some padding around the image?


      Thanks a ton in advance.



        • 1. Re: InDesign XML Import: Wrap text around inline images?
          Kasyan Servetsky Level 5

          I suggest you to change position in Anchored Object Options dialog box from Inline to Custom:


          For example, to get the effect in the screen-shot above, the following settings were used:



          1 person found this helpful
          • 2. Re: InDesign XML Import: Wrap text around inline images?
            Ultran Level 1


            Sorry for the delayed response and thanks much for the great feedback.


            So far thanks to your assist, I was able to set the default ancor options under Object -> Ancored Object -> Options (default). This didn't affect what I saw on the screen, but I was also able to select a photo and change the options in the same way.


            In your example, did you edit each image seperately, or is there a preset somewhere that will automatically apply to all images? When I imported remaining contnet, they lost any ancored object settings.



            Best regards,



            I did find the ancor object options that could be applied with object styles. Even if I do this manually, it's a huge time saver! Thanks for the help. Additional feedback on making this work automatically on XML import is still welcome.

            • 3. Re: InDesign XML Import: Wrap text around inline images?
              Kasyan Servetsky Level 5

              You can apply an object style to all anchored images by script. A text frame containing main flow should be selected.

              var doc = app.activeDocument;
              var textFrame =  app.selection[0];
              var rectangles = textFrame.texts[0].rectangles;
              if (rectangles.length > 0) {
                   for (var i=0; i < rectangles.length; i++) {
                        rectangles[i].appliedObjectStyle = doc.objectStyles.item("Cover");


              However, there is a better approach:

              Step 1

              Create place holders for a single "Book" element and format it as needed -- apply an object style to the cover.


              Step 2

              Import the xml file -- the placeholders are replaced with data from the 1st xml element


              Step 3

              Drag & drop the element containing all "Books" elements into the main flow -- all elements are placed and formatted the same way as in step 1.


              Finally, add a new page, click the overset text icon and autoflow text to add pages so that to fit all the text.


              Hope this helps.