mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-13 09:54:19 +01:00
feat: integrate Tesseract.js with improved language availability and font handling
- Refactored OCR page recognition to utilize a configured Tesseract worker. - Added functions to manage font URLs and asset filenames based on language. - Implemented language availability checks and error handling for unsupported languages. - Enhanced PDF workflow to display available OCR languages and handle user selections. - Introduced utility functions for resolving Tesseract asset configurations. - Added tests for OCR functionality, font loading, and Tesseract runtime behavior. - Updated global types to include environment variables for Tesseract and font configurations.
This commit is contained in:
1 parent
58c78b09d2
commit
77da6d7a7d
23 files changed
+1906
-564
No files matched your search
Vendored
+14
@@ -1 +1,15 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface ImportMetaEnv {
|
||||
readonly VITE_TESSERACT_WORKER_URL?: string;
|
||||
readonly VITE_TESSERACT_CORE_URL?: string;
|
||||
readonly VITE_TESSERACT_LANG_URL?: string;
|
||||
readonly VITE_TESSERACT_AVAILABLE_LANGUAGES?: string;
|
||||
readonly VITE_OCR_FONT_BASE_URL?: string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
readonly env: ImportMetaEnv;
|
||||
}
|
||||
|
||||
declare const __SIMPLE_MODE__: boolean;
|
||||
Reference in new issue
Block a user