Get annotation coordinates

57 views
Skip to first unread message

Laurent Biancardini

unread,
Dec 21, 2017, 11:34:07 AM12/21/17
to PDFTron PDFNet SDK
How do you get coordinates of an annotation (in Swift or any language) ? I tried:

annot.getRect().getX1() --> However I get an error: "Ambiguous use of getX1()"

Thank you in advance for your help.

Ryan

unread,
Dec 21, 2017, 8:54:42 PM12/21/17
to PDFTron PDFNet SDK
We are in progress of upgrading our API to work better with SWIFT.

In the meantime, please make the following change to PDFNet.framework/Headers/PDFNetOBJC.h

Comment out the getters and setters as below.

@interface PTPDFRect : TRN_rect

- (void*)getCptr;

- (instancetype)initWithCptr: (void*) cptr;

- (void)setSwigCMemOwn: (BOOL) own;

- (void)dealloc;

- (void)Attach: (PTObj*)obj;

- (BOOL)Update: (PTObj*)obj;

- (void)Set: (double)x1 y1:  (double)y1 x2:  (double)x2 y2:  (double)y2;

- (double)Width;

- (double)Height;

- (BOOL)Contains: (double)x y:  (double)y;

- (BOOL)IntersectRect: (PTPDFRect*)rect1 rect2:  (PTPDFRect*)rect2;

- (void)Normalize;

- (void)InflateWithAmount: (double)amount;

- (void)InflateWithXY: (double)x y:  (double)y;

//- (double)GetX1;

//- (double)GetY1;

//- (double)GetX2;

//- (double)GetY2;

//- (void)SetX1: (double)x1;

//- (void)SetY1: (double)y1;

//- (void)SetX2: (double)x2;

//- (void)SetY2: (double)y2;

- (instancetype)init;- (instancetype)initWithRect: (PTObj*)rect;- (instancetype)initWithX1: (double)x1 y1:  (double)y1 x2:  (double)x2 y2:  (double)y2;

@end

Laurent Biancardini

unread,
Dec 22, 2017, 12:22:10 PM12/22/17
to PDFTron PDFNet SDK
Works like a charm! Thanks Ryan.
Reply all
Reply to author
Forward
0 new messages