FPDFText_GetBoundedText method

int FPDFText_GetBoundedText(
  1. FPDF_TEXTPAGE text_page,
  2. double left,
  3. double top,
  4. double right,
  5. double bottom,
  6. Pointer<FPDF_WCHAR> buffer,
  7. int buflen,
)

Function: FPDFText_GetBoundedText Extract unicode text within a rectangular boundary on the page. Parameters: text_page - Handle to a text page information structure. Returned by FPDFText_LoadPage function. left - Left boundary. top - Top boundary. right - Right boundary. bottom - Bottom boundary. buffer - Caller-allocated buffer to receive UTF-16 values. buflen - Number of UTF-16 values (not bytes) that buffer is capable of holding. Return Value: If buffer is NULL or buflen is zero, return number of UTF-16 values (not bytes) of text present within the rectangle, excluding a terminating NUL. Generally you should pass a buffer at least one larger than this if you want a terminating NUL, which will be provided if space is available. Otherwise, return number of UTF-16 values copied into the buffer, including the terminating NUL when space for it is available. Comment: If the buffer is too small, as much text as will fit is copied into it. May return a split surrogate in that case.

Implementation

int FPDFText_GetBoundedText(
  FPDF_TEXTPAGE text_page,
  double left,
  double top,
  double right,
  double bottom,
  ffi.Pointer<ffi.UnsignedShort> buffer,
  int buflen,
) {
  return _FPDFText_GetBoundedText(
    text_page,
    left,
    top,
    right,
    bottom,
    buffer,
    buflen,
  );
}