Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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:
Kasyan
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.
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.
Copy link to clipboard
Copied
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.
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.
Kasyan