Automatic font size reduction in a PDF form | Community
Skip to main content
February 15, 2010
Question

Automatic font size reduction in a PDF form

  • February 15, 2010
  • 13 replies
  • 24073 views

Hello everybody!

I'm working with SAP.

On my current project I would like to implement a customer form via Adobe Lifecycle Designer.

I'm going to ask a developer to implement the following logic:

There is a fixed rectangular area in the form. This area should represent a text.

In case of long text I would like to reduce the font size to fit the text into the area. It should look like that

http://lh4.ggpht.com/_cAQDpIBg5Bg/S3glj2MIo6I/AAAAAAAAAIk/SN9vEwOEYCY/scale.jpg

Text alignment within the area is Horizontal Centered, Vertical Centered
Text wrap is on
Font is Arial, initial size is 10

Is it possible to implement?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

13 replies

Niall_O_Donovan
Level 10
February 15, 2010

OK,

This contains a second sample, where the textfield is set to 10pt and limits content to visible area:

But in this case the script is in the full event - setting the font to 0pt.

However it is not smooth - the user gets a beep when the field is full and has to exit and go back into the field to get the text to reduce in size.

This is as far as I can take it.

Hope that helps,

Niall

February 15, 2010

Unfortunately I forget to mention that in my case this field is to be read only and should be designed to represent a text string from the SAP system.

Regards,

Sergey

Niall_O_Donovan
Level 10
February 15, 2010

Hi Sergey,

In that case, I think the only options are:

  1. Leave the font to "0pt" and accept that in some situations short strings will be 12pt.
  2. Determine the number of characters that on average will fit into the field at 10pt. Then use the script to test the length of the string before it populates the field. If it is less than the max number of characters set the font size to 10pt. If it is more then set the font to 0pt.

I appreciate that this is not ideal, but I really think these are your only options.

Good luck,

Niall