Comment #2 on issue 1599 by aperr...@
gmail.com: Add a new public API to get text from a text object without reference to text page
https://bugs.chromium.org/p/pdfium/issues/detail?id=1599#c2I didn't find a function which allows to extract the text from a text object owned by another object (in a stamp annotation for example: FPDFPageObj_NewTextObj or FPDFPageObj_CreateTextObj, FPDFText_SetText then FPDFAnnot_AppendObject).
FPDFTextObj_GetText and FPDFText_GetText refer to the texts of a page returned by FPDFText_LoadPage which apparently does not extract the texts contained in sub-objects. I tried unsuccessfully to set NULL in the "text_page: FPDF_TEXTPAGE" parameters.
The solutions could be:
- allow the FPDFText_LoadPage function to read texts contained in sub-objects (with owner)
- add a new function that allows to directly reach a text object FPDF_PAGEOBJECT as it is possible in FPDFText_SetText
- adapt FPDFTextObj_GetText to be able to directly reach a text object FPDF_PAGEOBJECT without reference to the texts of a page returned by FPDFText_LoadPage