pdfOkToExtractText

Check to see if the PDF file allows text extraction.
int pdfOkToExtractText(PDFViewerHandle viewer)
This function returns non-zero if text extraction is allowed, or zero if the currently displayed PDF file is encrypted and does not allow extraction of text (or if no PDF file is currently open).

The owner password can be used to circumvent this: if a valid owner password was supplied to pdfLoadFileWithPassword, this function will always return non-zero.

If this function returns zero, pdfExtractTextFromPage will not return any text.

C:
if (!pdfOkToExtractText(viewer)) { /* the currently displayed PDF file is set to disallow text extraction - any call to pdfExtractTextFromPage will fail */ }
pdfExtractTextFromPage