Checks whether tesseract.js is available in the current environment and,
if so, returns a new OCR PDF loader instance; otherwise returns null.
The check is performed by attempting to resolve the package path using
Node's createRequire. This avoids a full async dynamic import at call
time while still being accurate.
Checks whether
tesseract.jsis available in the current environment and, if so, returns a new OCR PDF loader instance; otherwise returnsnull.The check is performed by attempting to resolve the package path using Node's
createRequire. This avoids a full async dynamic import at call time while still being accurate.Usage