Color is getting Overridden - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
Questions about iOS development and PDF
  • Page:
  • 1

TOPIC: Color is getting Overridden

Color is getting Overridden 3 weeks 3 days ago #14372

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 45
  • Thank you received: 0
//rectangle color is blue
plugin.setColor(Int32(bitPattern:0xFF0000FF), forFeature: 1)
//Underline color is yellow
plugin.setColor(Int32(bitPattern:0xFFFFFF00), forFeature: 2)

I have set different color for rectangle and line but still if i draw rectangle and then if i draw line over rectangle then the color of line is blue not yellow.

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

Color is getting Overridden 3 weeks 3 days ago #14374

  • federico
  • federico's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 68
  • Thank you received: 5
Dear apdeveloper,
Could you please post a more complete part of your code?
Which RadaeeSDK's version are you using?

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

Color is getting Overridden 3 weeks 15 hours ago #14376

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 561
  • Karma: 21
  • Thank you received: 65
Dear user,

which Swift version are you using? We already fixed this issue in recent versions.
We checked with the latest version ( 1.1.1 ) and it works correctly.

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

Color is getting Overridden 2 weeks 4 days ago #14386

  • apdeveloper
  • apdeveloper's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 45
  • Thank you received: 0
Dear team,

Thank you for your reply ,
But the error still exits in the latest swift version which 1.1.1
can you please help me out.

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

Color is getting Overridden 2 weeks 4 days ago #14388

  • emanuele
  • emanuele's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 561
  • Karma: 21
  • Thank you received: 65
Dear user,

we checked again, and we noticed that your code is setting the underline color value, not the line color (arrow annotation).
//rectangle color is blue
plugin.setColor(Int32(bitPattern:0xFF0000FF), forFeature: 1)
//Underline color is yellow
plugin.setColor(Int32(bitPattern:0xFFFFFF00), forFeature: 2)
In this case everything works as expected, but we noticed that arrow annotation color is using the rect annotation color.
You could easily fix in PDFView.m class, replacing
[page addAnnotLine:pt_cur :&pt_cur[1] :GLOBAL.g_rect_Width :0 :1 :GLOBAL.g_rect_color :GLOBAL.g_rect_color];
with
[page addAnnotLine:pt_cur :&pt_cur[1] :GLOBAL.g_rect_Width :0 :1 :GLOBAL.g_line_color :GLOBAL.g_line_color];
The feature value for line annotation color is missing in setColor method, but we introduce a new method to set global vars (and then color) in recent versions:
- add #import "include/PDFView/RDGlobal.h" in RadaeeSwift-Bridging-Header.h
- set the global var in this way after the plugin.show method:
//Create Reader instance from custom path
let reader = plugin.show(path, withPassword: "")
        
let global: RDGlobal = plugin.getGlobal() as! RDGlobal
global.g_ink_color = 0xFFFF0000;    // free hand drawing (red)
global.g_rect_color = 0xFF0000FF;   // rect (blue)
global.g_line_color = 0xFFFFFF00;   // arrow (yellow)
global.g_oval_color = 0xFF00FF00;   // oval (green)
You could find the complete global vars in RDGlobal.h

We will fix the ink color in next version, thank you for your report.

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

  • Page:
  • 1
Powered by Kunena Forum