/// Returns all characters that lie within the bounds of the given [PdfRect] in the
/// containing [PdfPage], in the order in which they are defined in the PDF file.
///
/// In complex custom layouts, the order in which characters are defined in the PDF file
/// and the order in which they appear visually during rendering (and thus the order in
/// which they are read by a user) may not necessarily match.
Returns all characters that lie within the bounds of the given [PdfRect] in the
containing [PdfPage], in the order in which they are defined in the PDF file.

In complex custom layouts, the order in which characters are defined in the PDF file
and the order in which they appear visually during rendering (and thus the order in
which they are read by a user) may not necessarily match.
Returns all characters that lie within the bounds of the given [ PdfRect ] in the containing [ PdfPage ] in the order in which they are defined in the PDF file . In complex custom layouts the order in which characters are defined in the PDF file and the order in which they appear visually during rendering ( and thus the order in which they are read by a user ) may not necessarily match .
pub fn inside_rect(&self, rect: PdfRect) -> String {
        // Retrieving the bounded text from Pdfium is a two-step operation. First, we call
        // FPDFText_GetBoundedText() with a null buffer; this will retrieve the length of
        // the bounded text in _characters_ (not _bytes_!). If the length is zero, then there is
        // no text within the given rectangle's boundaries.
        // If the length is non-zero, then we reserve a buffer (sized in words rather than bytes,
        // to allow for two bytes per character) and call FPDFText_GetBoundedText() again with a
        // pointer to the buffer; this will write the bounded text to the buffer in UTF16-LE format.
        let left = rect.left.value as f64;
        let top = rect.top.value as f64;
        let right = rect.right.value as f64;
        let bottom = rect.bottom.value as f64;
        let chars_count = self.bindings.FPDFText_GetBoundedText(
            self.handle,
            left,
            top,
            right,
            bottom,
            null_mut(),
            0,
        );
        if chars_count == 0 {
            // No text lies within the given rectangle.
            return String::new();
        }
        let mut buffer = create_sized_buffer(chars_count as usize);
        let result = self.bindings.FPDFText_GetBoundedText(
            self.handle,
            left,
            top,
            right,
            bottom,
            buffer.as_mut_ptr(),
            chars_count,
        );
        assert_eq!(result, chars_count);
        get_string_from_pdfium_utf16le_bytes(buffer.as_bytes().to_vec()).unwrap_or_default()
    }
pub fn inside_rect ( & self , rect : PdfRect ) -> String { // Retrieving the bounded text from Pdfium is a two-step operation. First, we call // FPDFText_GetBoundedText() with a null buffer; this will retrieve the length of // the bounded text in _characters_ (not _bytes_!). If the length is zero, then there is // no text within the given rectangle's boundaries. // If the length is non-zero, then we reserve a buffer (sized in words rather than bytes, // to allow for two bytes per character) and call FPDFText_GetBoundedText() again with a // pointer to the buffer; this will write the bounded text to the buffer in UTF16-LE format. let left = rect . left . value as f64 ; let top = rect . top . value as f64 ; let right = rect . right . value as f64 ; let bottom = rect . bottom . value as f64 ; let chars_count = self . bindings . FPDFText_GetBoundedText ( self . handle , left , top , right , bottom , null_mut ( ) , 0 , ) ; if chars_count == 0 { // No text lies within the given rectangle. return String :: new ( ) ; } let mut buffer = create_sized_buffer ( chars_count as usize ) ; let result = self . bindings . FPDFText_GetBoundedText ( self . handle , left , top , right , bottom , buffer . as_mut_ptr ( ) , chars_count , ) ; assert_eq ! ( result chars_count ) ; get_string_from_pdfium_utf16le_bytes ( buffer . as_bytes ( ) . to_vec ( ) ) . unwrap_or_default ( ) }
Returns all characters that lie within the bounds of the given [PdfRect] in the
containing [PdfPage], in the order in which they are defined in the PDF file.
Returns all characters that lie within the bounds of the given [ PdfRect ] in the containing [ PdfPage ] in the order in which they are defined in the PDF file .
&self
rect
PdfRect