#ifndef CST_PDF_H #define CST_PDF_H #include #ifdef __cplusplus extern "C" { #endif /* Text layer of a PDF, in page order, with no external dependency (no * poppler, no zlib): classic objects and object streams, FlateDecode plus * ASCIIHex/ASCII85, PNG/TIFF predictors, Tj/TJ/'/" text with per-font * ToUnicode CMaps and a WinAnsi / Latin-1 fallback. Scanned pages have no * text layer and are reported as such. * Returns a malloc'd NUL-terminated UTF-8 string, or NULL with err filled in * ("PDF is encrypted ...", "no extractable text ..."). *pages (optional) gets * the page count; the result is truncated at CST_PDF_TEXT_MAX bytes. */ char *cst_pdf_text(const void *data, size_t n, int *pages, char *err, size_t err_sz); #define CST_PDF_TEXT_MAX (4u * 1024u * 1024u) #ifdef __cplusplus } #endif #endif