FPDFText_GetCharIndexAtPos function

  1. @Native<Int Function(FPDF_TEXTPAGE, Double, Double, Double, Double)>(FPDF_TEXTPAGE, ffi.Double, ffi.Double, ffi.Double, ffi.Double)>()
int FPDFText_GetCharIndexAtPos(
  1. FPDF_TEXTPAGE text_page,
  2. double x,
  3. double y,
  4. double xTolerance,
  5. double yTolerance,
)

Function: FPDFText_GetCharIndexAtPos Get the index of a character at or nearby a certain position on the page. Parameters: text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function. x - X position in PDF "user space". y - Y position in PDF "user space". xTolerance - An x-axis tolerance value for character hit detection, in point units. yTolerance - A y-axis tolerance value for character hit detection, in point units. Return Value: The zero-based index of the character at, or nearby the point (x,y). If there is no character at or nearby the point, return value will be -1. If an error occurs, -3 will be returned.

Implementation

@ffi.Native<
  ffi.Int Function(
    FPDF_TEXTPAGE,
    ffi.Double,
    ffi.Double,
    ffi.Double,
    ffi.Double,
  )
>()
external int FPDFText_GetCharIndexAtPos(
  FPDF_TEXTPAGE text_page,
  double x,
  double y,
  double xTolerance,
  double yTolerance,
);