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

IOS add edit text box

More
10 years 5 months ago - 10 years 5 months ago #10517 by colliot
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?
Last edit: 10 years 5 months ago by colliot.
More
10 years 5 months ago #10539 by emanuele
Replied by emanuele on topic IOS add edit text box
Hi,
you should only add addEditTextBox method in PDFObjc class (in PDFPage implementation):
in PDFObjc.h:
Code:
-(bool)addEditTextBox:(const PDF_RECT *)rect :(int) line_clr :(float) line_w :(int) fill_clr :(float) tsize :(int) text_clr;

in PDFObjc.m:
Code:
-(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.
More
10 years 5 months ago #10543 by colliot
Replied by colliot on topic IOS add edit text box
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:
Code:
-(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
Time to create page: 0.393 seconds
Powered by Kunena Forum