Microsoft Windows Phone 8.1 support ends (13 Jul 2017)

Microsoft has ended support for Windows Phone 8.1

Questions about iOS development and PDF

Calculate the rect size for Page_addAnnotEditbox2

More
11 years 3 weeks ago - 11 years 3 weeks ago #9501 by mobileAsd
Hi,

We are trying to use the function Page_addAnnotEditbox2 and Page_setAnnotEditText to add text in a PDF document, however, we met the difficulty to set the proper rect dimension to the Page_addAnnotEditbox2. From the thread www.radaeepdf.com/forum/Android-developm...addannoteditbox#9392 , you are suggesting to use getTextBounds from Android. Could you please also suggest what will be the similar method to use in iOS? Or there is other right way to do so? Thanks
Last edit: 11 years 3 weeks ago by mobileAsd.
More
11 years 2 weeks ago #9529 by emanuele
Hi,

here is an example to get the text bounds in iOS:
Code:
UIFont *font = [UIFont fontWithName:@"Helvetica" size:12]; NSMutableAttributedString *string = [[NSMutableAttributedString alloc] initWithString:@"test string"]; [string addAttribute:NSFontAttributeName value:font range:NSMakeRange(0, string.length)]; CGSize textSize = [string size];

You can use this code to calculate the correct rect of your editbox
Time to create page: 0.384 seconds
Powered by Kunena Forum