Scroll to text highlight

Given an existing text highlight (instance of HighlightAnnot), how can I make the PDFViewCtrl scroll to it?

You can get the annotation’s coordinates, in page space, with Annot.GetRect. You will need to convert these coordinates to scrollable space, and then use PDFViewCtrl.OnScroll as follows:

//focus 
view.SetCurrentPage(page_num);
view.ConvPagePtToScreenPt(px, py, page_num);
view.SetZoom((int)px, (int)py, view.GetZoom());

//center
int width = view.GetBufferWidth();
int height = view.GetBufferHeight();
int dx = (int)(px - (double)width/2 + 0.5);
int dy = (int)(py - (double)height/2 + 0.5);
view.OnScroll(dx, dy);

You can change the scroll position in PDFViewCtrl with SetHScrollPos and SetVScrollPos.

There is also a method PDFViewCtrl.ShowRect ( annot.GetRect() ) that may be handy.