I have searched the text and found text.
if (resultCode == TextSearchResultCode.e_found)
{
hlts.Begin(PdfContent);
while (hlts.HasNext())
{
//Page cur_page = PdfContent.GetPage(hlts.GetCurrentPageNumber());
var p = hlts.GetCurrentPageNumber();
Page cur_page = PdfContent.GetPage(hlts.GetCurrentPageNumber());
double[] quads = hlts.GetCurrentQuads();
int quad_count = quads.Length / 8;
for (int i = 0; i < quad_count; ++i)
{
//assume each quad is an axis-aligned rectangle
int offset = 8 * i;
double x1 = Math.Min(Math.Min(Math.Min(quads[offset + 0], quads[offset + 2]), quads[offset + 4]), quads[offset + 6]);
double x2 = Math.Max(Math.Max(Math.Max(quads[offset + 0], quads[offset + 2]), quads[offset + 4]), quads[offset + 6]);
double y1 = Math.Min(Math.Min(Math.Min(quads[offset + 1], quads[offset + 3]), quads[offset + 5]), quads[offset + 7]);
double y2 = Math.Max(Math.Max(Math.Max(quads[offset + 1], quads[offset + 3]), quads[offset + 5]), quads[offset + 7]);
Highlight hl = Highlight.Create(PdfContent.GetSDFDoc(), new Rect(x1, y1, x2, y2));
hl.SetColor(new ColorPt(0, 1, 0));
hl.RefreshAppearance();
cur_page.AnnotPushBack(hl);
}
hlts.Next();
}
I checked the location and page number. All correct but no Highlight color. Here my color pure green. How can we place opacity?