Copy link to clipboard
Copied
My goal is to translate the original file (.indd) from English to Japanese. My Python code successfully translates the text and updates the fonts and language. However, I am encountering an issue where the translated text overflows the text frames (i.e., overset text).
Please advise if there’s any setting or attribute within the .idml file that can be updated using python code to automatically resize the text frame to fit the content.
Both original InDesign (.idml) and the Python-processed .idml file are attached for your reference.
Copy link to clipboard
Copied
Hi,
Look for EnableTextFrameAutoSizingOptions.
P.
Copy link to clipboard
Copied
I tried adding Auto Size options to the XML files in the Spreads folder of the .idml, as shown below, but it didn’t work:
<TextFramePreference TextColumnCount="1" TextColumnFixedWidth="38.35039370078738" TextColumnMaxWidth="0">
<Properties>
<InsetSpacing type="list">
<ListItem type="unit">0</ListItem>
<ListItem type="unit">0</ListItem>
<ListItem type="unit">0</ListItem>
<ListItem type="unit">0</ListItem>
</InsetSpacing>
</Properties>
<AutoSizingReferencePoint>TopLeftPoint</AutoSizingReferencePoint><AutoSizingType>HeightOnly</AutoSizingType></TextFramePreference>
Copy link to clipboard
Copied
Hi @aparna_6212 ,
look up DOM documentation for ExtendScript. There are a lot of similarities between poperties there and IDML / IDMS.
https://www.indesignjs.de/extendscriptAPI/indesign-latest/#TextFramePreference.html#d1e307842
Or look it up in IDMS files (Snippets) you export from InDesign text frames where all the necessary options are enabled.
Regards,
Uwe Laubender
( Adobe Community Expert )
Copy link to clipboard
Copied
I exported out the IDML after applying Fit Frame to Content and then compared the spread xmls of the orginal IDML. I see differences in the path points of the textframe. That makes me believe that all this option does is resize the frame according to the current content, i.e. it is not a property of the frame but a change to dimensions.
However, if you apply "Auto-Size" from the textframe properties that sets the frame properties and making corresponding change in the IDML does remove the overset. Looking at your IDML I see the problem. You have added
//This is from your IDML and does not work
<TextFramePreference TextColumnCount="1" TextColumnMaxWidth="0">
<Properties>
<InsetSpacing type="list">
<ListItem type="unit">0</ListItem>
<ListItem type="unit">0</ListItem>
<ListItem type="unit">0</ListItem>
<ListItem type="unit">0</ListItem>
</InsetSpacing>
</Properties>
<AutoSizingReferencePoint>TopLeftPoint</AutoSizingReferencePoint><AutoSizingType>HeightOnly</AutoSizingType></TextFramePreference>
//This works
<TextFramePreference TextColumnCount="1" TextColumnMaxWidth="0" AutoSizingType="HeightOnly" AutoSizingReferencePoint="TopLeftPoint">
<Properties>
<InsetSpacing type="list">
<ListItem type="unit">0</ListItem>
<ListItem type="unit">0</ListItem>
<ListItem type="unit">0</ListItem>
<ListItem type="unit">0</ListItem>
</InsetSpacing>
</Properties>
</TextFramePreference>
Attached the IDML I created
-Manan
Find more inspiration, events, and resources on the new Adobe Community
Explore Now