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

    InDesign XML Import: Wrap text around inline images?

    Ultran

      screenshot.jpg

       

      Howdy,

      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.

       

      Chris

        • 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:

          1.png

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

          2.png

          Kasyan

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

            Kasyan,

            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.

            gettingCloser.jpg

             

            Best regards,

             

            EDIT:

            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.

              SNAG-0000.png

              Step 2

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

              SNAG-0001.png

              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.

              SNAG-0002.png

              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.

               

              Kasyan