Highlighted

Adjust font size & textfield automatically (font size)

Explorer ,
Jan 31, 2019

Copy link to clipboard

Copied

Hello,

I tried many options, but I can't achieve the true solution...

I want that, if the textfield content is on one line, it should look like this: (font size larger, and position in the middle)

1)

2) if the content is displayed on several lines, the font should be smaller:

Unbenannt.PNG

At the moment, it is like this, when the content is on one line.... but it should fill up the whole textfield, and get the font size like screenshot nr.1.

Unbenannt1.PNG

The question is, how can I adjust the textfield and fontsize of my textfield content automatically?

FYI: the data comes from csv file (data merge)

My example is based on a unique paragraph style.

Since you use data merge, you insert a data-field in your document.

Apply this paragraph style to your data field.

Now, you need to create character styles with smaller font size.

In the example, I created two character styles: one for medium size (20pts), one for smaller size (15pts). Or you can use H&V scaling values too.

Do not apply manually those character styles to your data-field.

You are now going to use a Grep style in order to automatically apply those character styles to the entire paragraph depending on the number of characters in your paragraph.

If you want to learn more about Grep styles, see Drop caps and nested styles in InDesign

In the example, I used two Grep styles:

.{30,} means "if there are 30 or more characters

.{80,} means "if there are 80 or more characters

Of course, you will have to adjust the values accordingly to your needs.

I personally use this technique for data merging business cards. ^^

Here's the animated version of the example. I know it's not in English, but hopefully it'll help you to figure out the idea:

grep.gif

Views

773

Likes

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

Adjust font size & textfield automatically (font size)

Explorer ,
Jan 31, 2019

Copy link to clipboard

Copied

Hello,

I tried many options, but I can't achieve the true solution...

I want that, if the textfield content is on one line, it should look like this: (font size larger, and position in the middle)

1)

2) if the content is displayed on several lines, the font should be smaller:

Unbenannt.PNG

At the moment, it is like this, when the content is on one line.... but it should fill up the whole textfield, and get the font size like screenshot nr.1.

Unbenannt1.PNG

The question is, how can I adjust the textfield and fontsize of my textfield content automatically?

FYI: the data comes from csv file (data merge)

My example is based on a unique paragraph style.

Since you use data merge, you insert a data-field in your document.

Apply this paragraph style to your data field.

Now, you need to create character styles with smaller font size.

In the example, I created two character styles: one for medium size (20pts), one for smaller size (15pts). Or you can use H&V scaling values too.

Do not apply manually those character styles to your data-field.

You are now going to use a Grep style in order to automatically apply those character styles to the entire paragraph depending on the number of characters in your paragraph.

If you want to learn more about Grep styles, see Drop caps and nested styles in InDesign

In the example, I used two Grep styles:

.{30,} means "if there are 30 or more characters

.{80,} means "if there are 80 or more characters

Of course, you will have to adjust the values accordingly to your needs.

I personally use this technique for data merging business cards. ^^

Here's the animated version of the example. I know it's not in English, but hopefully it'll help you to figure out the idea:

grep.gif

Views

774

Likes

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
Jan 31, 2019 0
Adobe Community Professional ,
Jan 31, 2019

Copy link to clipboard

Copied

Hi erbe89911451:

There is an option in InDesign to auto-size a frame, but not one to auto-size the text within a frame.

~Barb

Likes

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
Reply
Loading...
Jan 31, 2019 1
Adobe Community Professional ,
Jan 31, 2019

Copy link to clipboard

Copied

Version of InDesign?

Are you working the Text field of a form?

I'd suggest opening the resulting PDF file in Acrobat Pro. If you have designed a Text Field, Acrobat or Reader will automatically scale down text to fit the field. No special setting necessary.

Screen Shot 2019-01-31 at 6.55.48 AM.png

Screen Shot 2019-01-31 at 6.56.23 AM.png

Screen Shot 2019-01-31 at 6.56.41 AM.png

Likes

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
Reply
Loading...
Jan 31, 2019 1
Adobe Community Professional ,
Jan 31, 2019

Copy link to clipboard

Copied

Note that if it’s a form, you will only see it in the PDF, not in InDesign.

Likes

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
Reply
Loading...
Jan 31, 2019 0
Adobe Community Professional ,
Jan 31, 2019

Copy link to clipboard

Copied

Jane is correct. That is the place where the person who fills the form adds their information. You can set a starting size and font in InDesign or in Acrobat, but it will be automatically rescaled as the field content is added. No way to preview that in InDesign ahead of time. You can test it out in Acrobat Pro in the Prepare Form tool and tweak the form there.

Likes

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
Reply
Loading...
Jan 31, 2019 0
Guide ,
Jan 31, 2019

Copy link to clipboard

Copied

You could use Grep styles to set a specific font size depending on the number of characters in the paragraph.

Please note that if you don't use a monospace font, it will be approximate but will fit text in most cases.

grepm.jpg

Now, if you're looking for something more robust, you can try scripts.

Have a look at this one (not tested): http://www.id-extras.com/products/fit-text-to-frame/

Likes

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
Reply
Loading...
Jan 31, 2019 3
Explorer ,
Feb 07, 2019

Copy link to clipboard

Copied

Hello,

thank you for answering. Could you please help me out, how it works automatically? I made 2 paragraph styles, but the fontsize get smaller only, when I'm selecting the right paragraph style. (I made one with 4pt, and the second style with 6pt)

Is your solution above completely? What are the other steps?

This cost me so much time, that I don't know how to solve this problem.

Likes

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
Reply
Loading...
Feb 07, 2019 0
Adobe Community Professional ,
Feb 07, 2019

Copy link to clipboard

Copied

erbe89911451,

Are you talking about text fields, or text frames?

They are 2 different things, and that's why you're getting different answers. Some people think you're talking about text fields, and some about text frames.

A text frame is just the regular container for text in InDesign. It doesn't have anything to do with Acrobat or form fields.

A text field is a type of form field for interactive PDF forms. In InDesign, you can click on a text frame, open the Buttons and Forms panel, and convert the frame into a text field. When the document is exported to an interactive PDF and opened in Acrobat, that text frame will show up as a text field into which text can be typed.

If you are creating a text field, you'll see a dropdown in the Buttons and Forms panel in InDesign that lets you choose the font size for the text field. The first option in that dropdown is "Auto". If you choose that, then in Acrobat the size of the text in the field will adjust automatically to fill the available space.

However, if the question is about text frames, there is no such option in InDesign (and Acrobat is not relevant). You will have to manually adjust the size of the text in frame to make it fit, or use one of the scripts referred to above.

Ariel

Likes

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
Reply
Loading...
Feb 07, 2019 1
Explorer ,
Feb 07, 2019

Copy link to clipboard

Copied

Hi,

I'm talking about documents, which filled with data doing data merge, there is no talk about typing any text to an interactive pdf.

But yea, it's not possible adjusting the fontsize automatically. I'd get old doing over thousand of documents manually.. that's why I asked about a solution, where its automatically.

Thanks anyway.

Likes

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
Reply
Loading...
Feb 07, 2019 0
Adobe Community Professional ,
Feb 07, 2019

Copy link to clipboard

Copied

erbe89911451  wrote

I'm talking about documents, which filled with data doing data merge, there is no talk about typing any text to an interactive pdf.

Hi,

I didn’t catch when you said Data Merge the first time and am tagging Colin Flashman​, data merge extraordinaire, to chime in. It’s nighttime in his time zone right now, so unless he stays up late, you may have to wait a bit.

Likes

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
Reply
Loading...
Feb 07, 2019 1
Guide ,
Feb 07, 2019

Copy link to clipboard

Copied

My example is based on a unique paragraph style.

Since you use data merge, you insert a data-field in your document.

Apply this paragraph style to your data field.

Now, you need to create character styles with smaller font size.

In the example, I created two character styles: one for medium size (20pts), one for smaller size (15pts). Or you can use H&V scaling values too.

Do not apply manually those character styles to your data-field.

You are now going to use a Grep style in order to automatically apply those character styles to the entire paragraph depending on the number of characters in your paragraph.

If you want to learn more about Grep styles, see Drop caps and nested styles in InDesign

In the example, I used two Grep styles:

.{30,} means "if there are 30 or more characters

.{80,} means "if there are 80 or more characters

Of course, you will have to adjust the values accordingly to your needs.

I personally use this technique for data merging business cards. ^^

Here's the animated version of the example. I know it's not in English, but hopefully it'll help you to figure out the idea:

grep.gif

Likes

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
Reply
Loading...
Feb 07, 2019 3
Adobe Community Professional ,
Feb 08, 2019

Copy link to clipboard

Copied

Hi there.

Yes, my answer is the same as Vinny38s, though his is on a larger scale. I have a video of the technique working on a smaller scale, but the principle is identical: Episode 3: Using GREP styles to fit text into a text frame in InDesign - YouTube  (headphone warning at the start)

Likes

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
Reply
Loading...
Feb 08, 2019 2
Explorer ,
Feb 08, 2019

Copy link to clipboard

Copied

Colin Flashman​ (great tutorial, thanks!)

vinny38​  I was writing a script with the hope it will work..., but I tried your solution first and it worked great. U saved me a lot of time. Thank you!

Likes

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
Reply
Loading...
Feb 08, 2019 0
BMG05 LATEST
New Here ,
Jun 08, 2020

Copy link to clipboard

Copied

Hello,

I am having a similar issue and tried to set the text to "auto" but auto isn't an option in my drop down box... Font size begins at 9pt and increases from there. Can you help me understand how to have "auto" as an option in my text field (using Acrobat Pro DC)

 

Thank you so much!

Likes

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
Reply
Loading...
Jun 08, 2020 0