fit text to annotation text box, or text box form field  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

fit text to annotation text box, or text box form field  SOLVED

Post by prime clinical systems »

Hi is there a method to auto fit by font size reduction to existing text annot or form field?
Found this: Call TxtEdit.EditCtl.SetAutoFitMinMax(Fontsizemin, fontsizemax) but not sure how to use.
Thanks
ce
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: fit text to annotation text box, or text box form field

Post by Sasha - Tracker Dev Team »

Hello Clifford,

I will consult with the developer who made this feature and will reply whether it's possible directly.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: fit text to annotation text box, or text box form field

Post by Sasha - Tracker Dev Team »

Hello Clifford,

Please see my reply here:
https://www.pdf-xchange.com/forum3 ... 60#p113702

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: fit text to annotation text box, or text box form field

Post by prime clinical systems »

Well, maybe I did not explain myself correctly. Say that I inserted a text form field that holds a persons name inline with some other typed text. Sometimes, the name is too long at the current font size to fit in the box, so that's why I asked about fitting the text to the box with smaller font so the name would not be cut off. If this is not possible, I believe I can do this with a picture box in VB that can calculate font size based on text length to fit the box, still playing with that, but thought you may have a way already.
Thanks
CE
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: fit text to annotation text box, or text box form field

Post by Sasha - Tracker Dev Team »

Hello Clifford,

The code that I gave you a link to does precisely what you need - it fits the text inside the Text Editor's box. Though too bad that it won't work for you.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
prime clinical systems
User
Posts: 211
Joined: Sun Aug 05, 2012 5:20 pm

Re: fit text to annotation text box, or text box form field

Post by prime clinical systems »

Actually the new build for the txtedit.FitByTextSize does this for text form fields, but a few observations about this new method.
For example, set (True,False) or (false,true) work the same way, perfect for form fields reducing the font size to fit the text, but for a text box it appends the text and auto adjusts for height, not width in either case. Typewriter tool always does width with these settings, which is fine because no way to know the width. Editing the content works same way.
If you set (True,True) for text box and call out does same as true false, false true, always adjusts for height, never width, form field text always fits text box, the edit content works to height and width
if you set (False, False) form field still auto fits text to box, and edit content still resizes by height.

Regardless, for me it works fine, just fitting text to form field was what I needed, and the autoexpand of text when I use my own editor is fine now as well, thanks.
ce
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: fit text to annotation text box, or text box form field

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply