Get annotation coordinates

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.

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

Works like a charm! Thanks Ryan.