FPDFText_SetText / FPDFText_GetText

84 views
Skip to first unread message

rsippl

unread,
Mar 19, 2018, 7:40:50 PM3/19/18
to pdfium
Hi,

Just by looking at the function names, you'd think these functions are setter and getter for the same thing. They're quite different, and they're declared in different header files.

In fpdf_edit.h:
// Set the text for a textobject. If it had text, it will be replaced.

PDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFText_SetText(FPDF_PAGEOBJECT text_object, FPDF_WIDESTRING text);


In fpdf_text.h:
// Extract unicode text string from the page.

FPDF_EXPORT
int FPDF_CALLCONV FPDFText_GetText(FPDF_TEXTPAGE text_page,
                                               
int start_index,
                                               
int count,
                                               
unsigned short* result);

Is there a way to get the text of a text object? That is, something like this:


// Extract unicode text string from a text object.

FPDF_EXPORT
int FPDF_CALLCONV FPDFTextObj_GetText(FPDF_PAGEOBJECT text_object,
                                                 
unsigned short* result);


n...@chromium.org

unread,
Mar 19, 2018, 7:55:52 PM3/19/18
to pdfium
I think I wrote FPDFText_SetText and did not see FPDFText_GetText, which makes the naming a bit awkward. Apologies for that! Regarding the method you mention, I don't think it exists. Please file a bug at https://bugs.chromium.org/p/pdfium/issues/list

rsippl

unread,
Mar 19, 2018, 8:31:28 PM3/19/18
to pdfium
Reply all
Reply to author
Forward
0 new messages