pdfGetSelectedText
Get the currently selected text.
char *pdfGetSelectedText(PDFViewerHandle viewer, int *length)
This function returns the currently selected text.
The text will be in the encoding set with pdfSetTextEncoding
.
The string will be null-terminated, but note that it may contain 0x00
bytes (depending on the current text encoding). See
pdfSetTextEncoding
.
The caller is responsible for calling pdfFreeMemory
on the
returned string.
Returns an empty string if there is no selection (or if there is no text in the selected region).
C:
char *text;
int length;
text = pdfGetSelectedText(viewer, &length);
/* do something with the text ... */
pdfFreeMemory(text);