I'm trying to save annotations externally in a database.
On Android i use Annotation.GetMarkupRects() and then Page.ObjsGetCharRect() for the first and last markup rect to get the startIndex and endIndex of markup. Then I use the indexes to delete the annotation from database
On iOS there is no method getMarkupRects() probably because it has a return value float
How can I get the start and end index of markup annotation in iOS from an existing annotation that I added to the PDF?
stronglee wrote: Use this method as follows:
int count = [annot getMarkupRects :NULL :0];
PDF_RECT *rects = (PDF_RECT *)malloc(sizeof(PDF_RECT) * count);
[annot getMarkupRects :rects :count];
I tried using this by adding an underline annotation with 3 lines.
When the app reached "int count = [annot getMarkupRects :NULL :0];" it worked properly (setting count = 3).
However, when the app arrived at "[annot getMarkupRects :rects :count];" the app crashed. I changed "[annot getMarkupRects :rects :count];" into "[annot getMarkupRects :rects :0];" It ran smoothly, but, as Rossi had said, the rects returned 0.