Skip to main content
Known Participant
Nov 16, 2011 1:18 PM UTC
Answered

[AI-CS5]How to convert the shape of text frame to rectangle?

Hi All,

could anyone suggest me how can I convert the shape of textbox to rectanglebox and fill any desired color into it? Can any API do so?

Here are steps that I follow in illustrator to convert the shape.

1. Create a textframe.

2. Select, choose "effect->convert to shape" menu-item.

3. Create a new fill from Appearence palette(Window->Appearance).

4. Fill the desired color from color palette(Window->Color).

I want to obtain the same result using API.

Plz help.

Thanks

D.A

This topic is closed to new replies. Start a new post to keep the conversation going.
A. Patterson
A. PattersonCorrect answer
Inspiring
Nov 18, 2011 2:49 PM UTC

All the text will be unrotated.


Here's the details:

Live Effect Name: "Adobe Shape Effects"

The parameters are:

Shape [ "Integer" ] = 0

DisplayString [ "String" ] = "Rectangle"

Absolute [ "Real" ] = 0

AbsWidth [ "Real" ] = 36

RelWidth [ "Real" ] = 18

AbsHeight [ "Real" ] = 36

CornerRadius [ "Real" ] = 9

RelHeight [ "Real" ] = 18

Presumably 'Shape' is 0-2 for Rectangle, Ellipse or Rounded Rectangle (might have the last two switched). For details on how to create & apply a live effect see this thread:

http://forums.adobe.com/thread/925871?tstart=0

5 replies

A. Patterson
Inspiring
Nov 16, 2011 3:22 PM UTC

Well, if you really want the same effect, you can actually apply that effect manually using the AILiveEffect suite. You just need to reverse engineer out what the parameters are for the Live Effect dictionary. Its not actually all that hard, just takes some test code.

Just out of curiosity though -- do you actually want an effect on the text that's a box, or are you just looking to draw a box behind the text in some way? Because one problem with using the Convert To Shape effect is that it doesn't do such a hot job on rotated text. If that's something that you care about, I recommend trying it out on rotated point text and seeing if the results are what you want. If they're okay, then going ahead with the effect is fairly straight forward. If not, you'll probably want to looking into bounds & rotated bounds to get the right box.

Translate
DeepAloneAuthor
Known Participant
Nov 17, 2011 11:53 AM UTC

Thanks for replying!

I just want to change the backgound of textbox with the color whose name is given inside the textbox.See the snapshot.

Translate
A. Patterson
Inspiring
Nov 17, 2011 2:57 PM UTC

But what about if the text is rotated? Or will all of your text be unrotated?

Translate