fix(pdf): flag scanned PDFs in pdf-to-text and serve text as UTF-8 (#603)

When a PDF has no text layer (scanned or image-only), pdf-to-text now
returns a 422 that points at the OCR tool instead of a silent empty file,
and text downloads carry charset=utf-8 so UTF-8 Arabic renders correctly
when the .txt is viewed inline.

Fixes #589
This commit is contained in:
SnapOtter
2026-07-21 16:26:43 +08:00
committed by GitHub
parent 43334324c4
commit 7d37f6e6f5
8 changed files with 109 additions and 19 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ function resolvePython(): string | null {
return null;
}
const pythonBin = resolvePython();
export const pythonBin = resolvePython();
/** Check whether a Python module is importable by the resolved interpreter. */
export function pythonWith(mod: string): boolean {