Copy link to clipboard
Copied
Hello,
I have created a plugin to create highlight annotation using acrobat plugin SDK.
Now, I want to search through comments of annotations.
How can I achieve this using acrobat plugin api?
Thank you in advance!
Copy link to clipboard
Copied
You can use the Search APIs or do it yourself.
Copy link to clipboard
Copied
Hello,
I used Search APIs to search through comments:
Here is my code snippet:
ASText searchKey;
searchKey = ASTextFromUnicode((ASUTF16Val*)reqText, kUTF16HostEndian);
SearchQueryDataRec srcQuery;
memset(&srcQuery, 0, sizeof(SearchQueryDataRec));
srcQuery.size = sizeof(SearchQueryDataRec);
srcQuery.query = searchKey;
srcQuery.type = kSearchActiveDoc;
srcQuery.scope = kSearchDocumentText | kSearchMarkup;
srcQuery.maxDocs = 1;
SearchExecuteQueryEx(&srcQuery);
ASTextDestroy(searchKey);
As per the documentation, kSearchMarkup option is used to search markups (In my case,annotations).
But it is not searching through annotation comments.
It gives me "Not found" error in a search panel at left.
Where am I wrong in this code?
Thank you in advance!
Copy link to clipboard
Copied
SearchMarkup will search the contents of markup annotations. What type of annot are you using?
Copy link to clipboard
Copied
I am using highlight annotation.
Copy link to clipboard
Copied
Then it will find the text in your annot as highlights are markup.
Copy link to clipboard
Copied
Please tell me what should I use to search for comments in the highlight annotation.
Copy link to clipboard
Copied
Exactly what you are doing…
If you add a highlight with Acrobat and then run your search, does it find it? I wonder if your annotations are not correct.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now