We have a webapp where we draw a map for a event we host, now we are trying to get the datasaved into our database into indesign to be able to edit and print it from there.
the webversion map looks like this:
the code im using for this atm is
<Rectangle Self="u133" StrokeWeight="0.1" FillColor="Color/u13b" strokecolor="Color/white" ItemTransform="12 0 0 8 180 60">
full version is here: http://nieuws.holapress.com/plattegrond/xml/stands.php?hal=1 i save this as a idms and i place it in indesign then.
the outcome of that looks like this:
this is perfect but now im running into the problem that we need numbers inside every box and i cant seem to get that to work properly, does anyone know how i would be able to get text in every box and align it to be in the middle?
Thanks in advance,
I'm afraid the solution will require quite a bit more code, hopefully this is something you can adjust so that the code is formatted for you properly. I believe the best way will be to change your rectangles to be "text frames" so that they can contain text, and text within them can be aligned based on the rectangle/text-frame bounds.
Define Paragraph Styles
First, you'll have to declare a "Paragraph Style" (similar conceptually to CSS) for how you want the text within each of these boxes to be formatted (font, size, color, etc):
Create Boxes
Next, you'll have to declare all of the frames as well as declare a sort of ID as
ParentStory="
[Story ID]"
for which text (we'll define the actual text later) will be inserted into this frame:I noticed that it looks like you sized your rectangles by using the
ItemTransform
keyword, but I would advise against this since it will also transform the text within the frame (will distort the characters). Instead, you'll need to define each box by providing the coordinates of the four corners of each box relative to a single insertion point (the point you click when placing the IDMS file into an InDesign document) - I'd recommend picking the upper leftmost corner of your whole map and using coordinates for each text frame relative to that position - in this case a positive Y value will be below the insertion point. For reference, the units default to Points, which translates to 1" = 72pts.I also noticed that your web version has different colors, you could apply those here by adding additional color definitions right after the opening
Document
tag, and then assigning the appropriate color's name toFillColor="
[color name]"
portion of theTextFrame
element.You would add as many
TextFrame
elements as you need between theSpread
tags, and then after closing/Spread
, begin defining the text that goes into each frame.Adding Text to the boxes
Make sure to identify each "story" by assigning
Story Self="
[Story ID]"
to match what you assigned toParentStory
within theTextFrame
s above:After all of the stories, then you can close the document with
/Document
.Sample
A complete file sample with 3 different frames each with their own text would look like this pastebin.