WARNING: this is a very old thread and is no longer possible to extract text this way (eg. fz_new_text_sheet
is no longer exported by muPDF). I have wasted an entire morning because copilot seems to be recommending code of the same nature.
I am trying to find the "modern" way to do it (using fz_new_stext_page
?) and will report back