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

TOPIC:

Changing text color for Page_addAnnotEditbox2 8 years 6 months ago #9701

  • mobileAsd
  • mobileAsd's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
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.

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

Changing text color for Page_addAnnotEditbox2 8 years 6 months ago #9709

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

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

Changing text color for Page_addAnnotEditbox2 8 years 6 months ago #9711

  • mobileAsd
  • mobileAsd's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
Hi,

We are using the version 3.3.7, thanks.

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

Changing text color for Page_addAnnotEditbox2 8 years 6 months ago #9729

  • emanuele
  • emanuele's Avatar
  • Offline
  • User is blocked
  • User is blocked
  • Posts: 580
  • Thank you received: 67
Here is the sample method used to check the feature in PDFView class:
- (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
-(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
The following user(s) said Thank You: mobileAsd

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

Last edit: by emanuele.

Changing text color for Page_addAnnotEditbox2 8 years 6 months ago #9750

  • mobileAsd
  • mobileAsd's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 25
  • Thank you received: 0
It seems the alpha value for the line_clr must be 0xFF, if not text color will not be changed, thanks.

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

  • Page:
  • 1
Powered by Kunena Forum