FPDFText_CountRects method

int FPDFText_CountRects(
  1. FPDF_TEXTPAGE text_page,
  2. int start_index,
  3. int count
)

Function: FPDFText_CountRects Counts number of rectangular areas occupied by a segment of text, and caches the result for subsequent FPDFText_GetRect() calls. Parameters: text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function. start_index - Index for the start character. count - Number of characters, or -1 for all remaining. Return value: Number of rectangles, 0 if text_page is null, or -1 on bad start_index. Comments: This function, along with FPDFText_GetRect can be used by applications to detect the position on the page for a text segment, so proper areas can be highlighted. The FPDFText_* functions will automatically merge small character boxes into bigger one if those characters are on the same line and use same font settings.

Implementation

int FPDFText_CountRects(FPDF_TEXTPAGE text_page, int start_index, int count) {
  return _FPDFText_CountRects(text_page, start_index, count);
}