Calculate the rect size for Page_addAnnotEditbox2 - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC: Calculate the rect size for Page_addAnnotEditbox2

Calculate the rect size for Page_addAnnotEditbox2 3 years 2 months ago #9501

  • mobileAsd
  • mobileAsd's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 25
  • Thank you received: 0
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

Please Log in or Create an account to join the conversation.

Last edit: by mobileAsd.

Calculate the rect size for Page_addAnnotEditbox2 3 years 2 months ago #9529

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 516
  • Karma: 15
  • Thank you received: 56
Hi,

here is an example to get the text bounds in iOS:
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
The following user(s) said Thank You: mobileAsd

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum