Is there a "fit text to box" method?

A forum for questions or concerns related to the PDF-XChange Core API SDK

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, 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
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Is there a "fit text to box" method?

Post by whoit »

If I create a TextBlock or TextLine using ContentCreator, is there a method for
automatically setting the font size, based on a string, to fit the Box?

For example, if I have the string "This is my sample text"
and a TextBlock or TextLine that is 20 points wide, is there a property
that will atuomatcally scale the font size to fit the Box?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Is there a "fit text to box" method?

Post by Sasha - Tracker Dev Team »

Hello Wayne,

The algorithm that you should use is similar to this:
viewtopic.php?f=67&t=30776#p123382

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
whoit
User
Posts: 269
Joined: Tue Jul 07, 2015 3:30 pm

Re: Is there a "fit text to box" method?

Post by whoit »

And, is there a way to add text to a PDF besides ShowtextBlock, ShowTextLine, Watermark, Annotation ?
Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Is there a "fit text to box" method?

Post by Sasha - Tracker Dev Team »

Hello Wayne,

Well there are Headers And Footers, but I doubt that you needed something like it. I'm afraid these are all of the methods available and they pretty much cover all of the needs.

Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply