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

Changing text color for Page_addAnnotEditbox2

More
10 years 5 months ago #9701 by mobileAsd
Hi,

We are using the iOS function Page_addAnnotEditbox2 to create the textbox in our documents. There should be parameter for the text color according to the API, however it doesn't work. Could The same color value is successfully used for another function Page_addAnnotMarkup2, could you please help have a look in that issue? Thanks.
More
10 years 5 months ago #9709 by emanuele
Hi,

I checked Page_addAnnotEditbox2 method, and also text_clr param works correctly (I used this color format: 0xFF00FF00).
Which library version are you using?
More
10 years 5 months ago #9711 by mobileAsd
Hi,

We are using the version 3.3.7, thanks.
More
10 years 5 months ago - 10 years 5 months ago #9729 by emanuele
Here is the sample method used to check the feature in PDFView class:
Code:
- (void)addEditTextBox { struct PDFV_POS pos; [m_view vGetPos:&pos :100 * m_scale :100 * m_scale]; if(pos.pageno>=0) { PDFVPage *vpage = [m_view vGetPage:pos.pageno]; if( !vpage ) return; PDFPage *page = [vpage GetPage]; if (!page) { return; } m_modified = true; PDF_RECT rect; rect.top = 100; rect.left = 100; rect.bottom = 150; rect.right = 350; bool ret = [page addAnnotEditbox:&rect :0xFF000000 :3 :0xFFFFFFFF :12 :0xFF00FF00]; PDFAnnot *annot = [page annotAtIndex: [page annotCount] - 1]; [annot setEditText:@"TEST"]; [m_view vRenderSync:pos.pageno]; [m_doc save]; } }

And here is the addAnnotEditbox method created in PDFObjc class to call Page_addAnnotEditbox2
Code:
-(BOOL)addAnnotEditbox:(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); }

I hope this sample will help you
Last edit: 10 years 5 months ago by emanuele.
More
10 years 5 months ago #9750 by mobileAsd
It seems the alpha value for the line_clr must be 0xFF, if not text color will not be changed, thanks.
Time to create page: 0.402 seconds
Powered by Kunena Forum