- Posts: 25
- Thank you received: 0
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
10 years 5 months ago #9701
by mobileAsd
Changing text color for Page_addAnnotEditbox2 was created 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.
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.
10 years 5 months ago #9709
by emanuele
Replied by emanuele on topic Changing text color for Page_addAnnotEditbox2
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?
I checked Page_addAnnotEditbox2 method, and also text_clr param works correctly (I used this color format: 0xFF00FF00).
Which library version are you using?
10 years 5 months ago #9711
by mobileAsd
Replied by mobileAsd on topic Changing text color for Page_addAnnotEditbox2
Hi,
We are using the version 3.3.7, thanks.
We are using the version 3.3.7, thanks.
10 years 5 months ago - 10 years 5 months ago #9729
by emanuele
Replied by emanuele on topic Changing text color for Page_addAnnotEditbox2
Here is the sample method used to check the feature in PDFView class:
And here is the addAnnotEditbox method created in PDFObjc class to call Page_addAnnotEditbox2
I hope this sample will help you
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.
10 years 5 months ago #9750
by mobileAsd
Replied by mobileAsd on topic Changing text color for Page_addAnnotEditbox2
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