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

TOPIC:

IOS add edit text box 8 years 1 week ago #10517

  • colliot
  • colliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
i'm trying to implement an edit text box on pdf with your solution, following this item in the knowledges base: www.radaeepdf.com/support/knowledge-base...component&kbartid=42

but the methods "addEditTextBox" don't seem to be part of the PDFPage type? what am i doing wrong?

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

Last edit: by colliot.

IOS add edit text box 8 years 5 days ago #10539

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Hi,
you should only add addEditTextBox method in PDFObjc class (in PDFPage implementation):
in PDFObjc.h:
-(bool)addEditTextBox:(const PDF_RECT *)rect :(int) line_clr :(float) line_w :(int) fill_clr :(float) tsize :(int) text_clr;

in PDFObjc.m:
-(bool)addEditTextBox:(const PDF_RECT *)rect :(int) line_clr :(float) line_w :(int) fill_clr :(float) tsize :(int) text_clr
{
    return Page_addAnnotEditbox2(m_page, rect, line_clr, line_w, fill_clr, tsize, text_clr);
}

we also fix the Knowledge Base article that missed this step.
Anyway we will include that method in the next release.
The following user(s) said Thank You: colliot

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

IOS add edit text box 8 years 5 days ago #10543

  • colliot
  • colliot's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 11
  • Thank you received: 0
Hi,

by the way after testing the knowledge base solution, i found that the edit box annotation is not created at the place clicked (when called with the x/y parameters of onSingleTapped)

so a more proper way to add an edit box annotation would be:
-(void)vAddEditText:(CGPoint)point

{
    struct PDFV_POS pos;

    [m_view vGetPos:&pos :point.x * m_scale :point.y * m_scale];
    
    PDF_RECT rect;
    rect.left=pos.x;
    rect.right=pos.x + 100.0;
    rect.top=pos.y;
    rect.bottom=pos.y + 50.0;
    
    PDFVPage *vpage = [m_view vGetPage:m_cur_page];    
    if( !vpage )
      return;

    PDFPage *page = [vpage GetPage];
    if (!page)         
        return;

    [page addEditTextBox:&rect :0xFF000000 :0xFFFF00FF :0x00000000 :12 :0xFFFF0000];    
    PDFAnnot *textAnnot = [page annotAtIndex: [page annotCount] - 1];
    [textAnnot setEditText:@"example text"];

    [m_view vRenderAsync:m_cur_page];
}

and thanks for you answer

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

  • Page:
  • 1
Powered by Kunena Forum