Jump to content

CopyfitLine not working


Recommended Posts

I am needing to use the CopyfitLine feature, but it is not working. Here is my code:


var BoxWidth = FindTextFrame("email box").GetSettableTextWidth()

return CopyfitLine("", Field("Email"), "Minion Pro SmBd", 10, BoxWidth, 6, false);


Return strings as tagged text is checked.


I tested the variable "BoxWidth", and it is returning the correct value.

I deleted the variable "BoxWidth" and entered the point size value directly into the CopyfitLine, and it will not scale.

I changed this all the way down to values of 100, 50, 10 and even 1, and it still will not scale.

I thought it might be a problem with the @ symbol in Field("Email"), but it still doesn't work with other data fields that just contain plain text.


Rather stumped.


FusionPro VDP Creator 8.2.5

Mac OS 10.6.8

Acrobat 10.1.7

Link to comment
Share on other sites

Check out the CopyfitLine function. It will automatically select the best size to make your text fit. The "How to use Copyfitting"

article in the Knowledge Base explains it:


Search for "CopyfitLine".

Here's the relevant part of the article:

<begin cite>

The CopyfitEmail() function works by identifying the @ character and copyfitting everything to the right. If you want to copyfit the entire line, use the CopyfitLine() function instead. It is used in a similar manner, although there are some added attributes.

The basic function reads:

CopyfitLine(staticpart, dynpart, font, size, width, minimum, justwidth)

• staticpart – written as a string, this declares the text that should remain static and not be copyfitted.

• dynpart – written as a string, this declares the text that should be copyfitted.

• font – this is the name of the typeface to be used when copyfitting.

• size – this is the size of the text that is not to be adjusted or fitted.

• width – this is the width of the frame, in points.

• minimum – this is the minimum font size, in points, that should be used when copyfitting.

• justwidth – expressed as a boolean (true or false), this tells FusionPro to stretch the text’s width (true) or leave the width as-is (false).

For example, you work for a company that is a division of a larger corporation, Clear Sound Concepts – a division of MicroComm Global. You only want to copyfit the text “a division of MicroComm Global” while leaving your company’s name as- is. The division name is contained in the field called “Division” and the corporation name is contained in the field “Company”. The rule would look like this:

CopyfitLine(Field(“Division”) + “ - ”, Field(“Company”), “Arial”, 12, 300, 8, true); <end cite>

In your case you only have a "dynamic" part, so your rule should look something like this:

return CopyfitLine("", Field("Email"), "Minion Pro SmBd", 10, 50, 6, false);

Change the font name and frame width as appropriate.

Or you can write your own Copyfit logic using the FusionProTextMeasure object.

Link to comment
Share on other sites



Thank you for your response. However, I am already doing what you are saying to do. I even copied your sample code and put it into my rule, and the text still will not scale. I have even gone to the ridiculous extreme of saying my base font size is 200, my width is 50, and my minimum font is 1, and it forces everything to be 200 pt.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...