Skip to main content
Participant
August 7, 2013
Question

Resizing text to frame in data merge

  • August 7, 2013
  • 2 replies
  • 4053 views

Hi all,

I've been asked to automate the layout and printing of thousands of degree certificates and I've used a data merge from an excel spreadsheet to insert the data into my InDesign CS6 document. Everything works great except in the case of degree names which are very long.

Is there a way for the text size to be automatically reduced to fit on a single line within a particular size frame? I don't want the frame to be resized to fit the text. I want the text to resize to fit the frame.

Help! I'm pulling my hair out.

Tx,

Chris

This topic has been closed for replies.

2 replies

Colin Flashman
Community Expert
Community Expert
August 8, 2013

This may not need to be scripted. I did a blog-piece on this using name-badges but is also applicable to headlines and any instance of text that has to fit within a placeholder:

http://colecandoo.wordpress.com/2012/02/18/square-pegs-now-fit-into-round-holes/

hope this helps

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!
Participant
December 23, 2014

OMG, Awesome!  Totally answered the question perfectly

Techi_Panda
Inspiring
August 7, 2013

Hi Try this, I think this helps

//Select your text frame and execute this script

//you can loop through all your textframes to select it

var frame_overflow =app.selection[0].overflows;

    while(frame_overflow==true){

        font_size = app.selection[0].paragraphs[0].pointSize;

        app.selection[0].paragraphs[0].pointSize=font_size-1;

        frame_overflow =app.selection[0].overflows;

    }

Thank you

arul

http://in.linkedin.com/pub/arul-raja/14/672/681

kikidotcaAuthor
Participant
August 7, 2013

Hi Arul,

Thanks for that. I selected the text frame that's causing me trouble and ran the script but when I do my data merge, the text still didn't resize. It gives me overset text if I turn off Auto-Size or it goes unto two lines if Auto-Size is on. Any ideas why?

Christine

Techi_Panda
Inspiring
August 8, 2013

Hi Christine

When you set Auto-size to your text frame, this option will re-size your text frame either hight or width or both. The option will not do anything anything with your text-size. You have to use the scripting way to re-size your text!