• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

InDesign XML Import: Wrap text around inline images?

Community Beginner ,
Jan 07, 2011 Jan 07, 2011

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 07, 2011 Jan 07, 2011

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 18, 2011 Jan 18, 2011

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jan 19, 2011 Jan 19, 2011

Copy link to clipboard

Copied

LATEST

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.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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines