Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC:

Calculate the rect size for Page_addAnnotEditbox2 8 years 7 months ago #9501

  • mobileAsd
  • mobileAsd's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • 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 8 years 7 months ago #9529

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
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