BabelDOC 0.3.69__tar.gz → 0.3.71__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {babeldoc-0.3.69 → babeldoc-0.3.71}/PKG-INFO +3 -1
- {babeldoc-0.3.69 → babeldoc-0.3.71}/README.md +2 -0
- babeldoc-0.3.71/babeldoc/__init__.py +1 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/const.py +1 -1
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/backend/pdf_creater.py +21 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/detect_scanned_file.py +6 -3
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/high_level.py +15 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/main.py +8 -1
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/translation_config.py +6 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/pyproject.toml +2 -2
- {babeldoc-0.3.69 → babeldoc-0.3.71}/uv.lock +1 -1
- babeldoc-0.3.69/babeldoc/__init__.py +0 -1
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.cursorignore +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/ISSUE_TEMPLATE/bug_report.yaml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/ISSUE_TEMPLATE/feature_request.yaml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/PULL_REQUEST_TEMPLATE/pr_form.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/dependabot.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/labels.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/release-drafter.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/workflows/codeql.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/workflows/docs.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/workflows/labeler.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/workflows/lint.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/workflows/pr-lint.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/workflows/publish-to-pypi.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.github/workflows/test.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.gitignore +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/.pre-commit-config.yaml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/LICENSE +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/assets/assets.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/assets/embedding_assets_metadata.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/asynchronize/__init__.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/converter.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/__init__.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/babeldoc_exception/BabelDOCException.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/backend/__init__.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/frontend/__init__.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/frontend/il_creater.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/il_version_1.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/il_version_1.rnc +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/il_version_1.rng +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/il_version_1.xsd +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/__init__.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/add_debug_information.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/automatic_term_extractor.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/il_translator.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/il_translator_llm_only.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/layout_parser.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/paragraph_finder.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/remove_descent.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/styles_and_formulas.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/table_parser.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/midend/typesetting.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/translator/__init__.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/translator/cache.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/translator/translator.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/utils/atomic_integer.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/utils/fontmap.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/utils/layout_helper.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/utils/mupdf_helper.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/utils/paragraph_helper.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/utils/priority_thread_pool_executor.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/utils/style_helper.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/utils/zstd_helper.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/xml_converter.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/docvision/README.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/docvision/__init__.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/docvision/base_doclayout.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/docvision/doclayout.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/docvision/rpc_doclayout.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/docvision/table_detection/rapidocr.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/format/office/__init__.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/glossary.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfinterp.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/LICENSE +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/__init__.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/_saslprep.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/arcfour.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/ascii85.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/casting.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/ccitt.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/78-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/78-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/78-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/78-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/78-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/78-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/78ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/78ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/83pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/83pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/90ms-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/90ms-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/90msp-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/90msp-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/90pv-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/90pv-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Add-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Add-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Add-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Add-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/B5pc-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/B5pc-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/CNS-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/CNS-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/CNS1-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/CNS1-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/CNS2-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/CNS2-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/ETHK-B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/ETHK-B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/ETen-B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/ETen-B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/ETenms-B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/ETenms-B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Ext-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Ext-RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Ext-RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Ext-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GB-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GB-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GB-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GB-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBK-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBK-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBK2K-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBK2K-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBKp-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBKp-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBT-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBT-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBT-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBT-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBTpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBTpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/GBpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKdla-B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKdla-B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKdlb-B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKdlb-B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKgccs-B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKgccs-B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKm314-B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKm314-B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKm471-B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKm471-B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKscs-B5-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/HKscs-B5-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Hankaku-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Hankaku-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Hiragana-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Hiragana-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSC-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSC-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSC-Johab-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSC-Johab-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSCms-UHC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSCms-UHC-HW-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSCms-UHC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSCpc-EUC-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/KSCpc-EUC-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Katakana-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Katakana-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/NWP-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/NWP-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/README.txt +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/RKSJ-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/RKSJ-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Roman-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/Roman-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniCNS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniCNS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniCNS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniCNS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniCNS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniCNS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniCNS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniCNS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniGB-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniGB-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniGB-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniGB-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniGB-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniGB-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniGB-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniGB-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UCS2-HW-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS2004-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS2004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJIS2004-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJISX0213-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniJISX02132004-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniKS-UCS2-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniKS-UCS2-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniKS-UTF16-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniKS-UTF16-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniKS-UTF32-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniKS-UTF32-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniKS-UTF8-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/UniKS-UTF8-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/WP-Symbol-H.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/WP-Symbol-V.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/to-unicode-Adobe-CNS1.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/to-unicode-Adobe-GB1.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Japan1.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmap/to-unicode-Adobe-Korea1.pickle.gz +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/cmapdb.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/converter.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/data_structures.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/encodingdb.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/fontmetrics.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/glyphlist.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/high_level.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/image.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/jbig2.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/latin_enc.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/layout.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/lzw.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/pdfcolor.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/pdfdevice.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/pdfdocument.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/pdfexceptions.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/pdffont.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/pdfinterp.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/pdfpage.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/pdfparser.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/pdftypes.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/psexceptions.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/psparser.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/py.typed +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/runlength.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/settings.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/pdfminer/utils.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/progress_monitor.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/result_merger.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/split_manager.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/tools/generate_font_metadata.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/tools/italic_assistance.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/tools/italic_recognize_tool.py +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/CODE_OF_CONDUCT.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/CONTRIBUTING.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/CONTRIBUTOR_REWARD.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/ImplementationDetails/AsyncTranslate/AsyncTranslate.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/ImplementationDetails/ILTranslator/ILTranslator.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/ImplementationDetails/PDFCreation/PDFCreation.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/ImplementationDetails/PDFParsing/PDFParsing.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/ImplementationDetails/ParagraphFinding/ParagraphFinding.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/ImplementationDetails/README.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/ImplementationDetails/StylesAndFormulas/StylesAndFormulas.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/ImplementationDetails/Typesetting/Typesetting.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/README.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/deploy.sh +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/example/demo_glossary.csv +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-banner.png +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.png +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-big-logo-darkmode-with-transparent-background.svg +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-big-logo-with-transparent-background.png +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-big-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-big-logo.png +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-contributor_reward_example.png +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-preview.gif +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-small-logo-with-transparent-background.png +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-small-logo-with-transparent-background.svg +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/images/babeldoc-small-logo.png +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/index.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/intro-to-pdf-object.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/requirements.txt +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/docs/supported_languages.md +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/mkdocs.yml +0 -0
- {babeldoc-0.3.69 → babeldoc-0.3.71}/tests/test_translation_config.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: BabelDOC
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.71
|
|
4
4
|
Summary: Yet Another Document Translator
|
|
5
5
|
Project-URL: Homepage, https://github.com/funstory-ai/BabelDOC
|
|
6
6
|
Project-URL: Issues, https://github.com/funstory-ai/BabelDOC/issues
|
|
@@ -212,6 +212,7 @@ uv run babeldoc --files example.pdf --files example2.pdf --openai --openai-model
|
|
|
212
212
|
- `--ocr-workaround`: Use OCR workaround (default: False). Only suitable for documents with black text on white background. When enabled, white rectangular blocks will be added below the translation to cover the original text content, and all text will be forced to black color.
|
|
213
213
|
- `--auto-enable-ocr-workaround`: Enable automatic OCR workaround (default: False). If a document is detected as heavily scanned, this will attempt to enable OCR processing and skip further scan detection. See "Important Interaction Note" below for crucial details on how this interacts with `--ocr-workaround` and `--skip-scanned-detection`.
|
|
214
214
|
- `--primary-font-family`: Override primary font family for translated text. Choices: 'serif' for serif fonts, 'sans-serif' for sans-serif fonts, 'script' for script/italic fonts. If not specified, uses automatic font selection based on original text properties.
|
|
215
|
+
- `--only-include-translated-page`: Only include translated pages in the output PDF. This option is only effective when `--pages` is used. (default: False)
|
|
215
216
|
|
|
216
217
|
- `--rpc-doclayout`: RPC service host address for document layout analysis (default: None)
|
|
217
218
|
- `--working-dir`: Working directory for translation. If not set, use temp directory.
|
|
@@ -320,6 +321,7 @@ disable-rich-text-translate = false
|
|
|
320
321
|
use-alternating-pages-dual = false
|
|
321
322
|
watermark-output-mode = "watermarked" # Choices: "watermarked", "no_watermark", "both"
|
|
322
323
|
max-pages-per-part = 50 # Automatically split the document for translation and merge it back.
|
|
324
|
+
only_include_translated_page = false # Only include translated pages in the output PDF. Effective only when `pages` is used.
|
|
323
325
|
# no-watermark = false # DEPRECATED: Use watermark-output-mode instead
|
|
324
326
|
skip-scanned-detection = false # Skip scanned document detection for faster processing
|
|
325
327
|
auto_extract_glossary = true # Set to false to disable automatic term extraction
|
|
@@ -161,6 +161,7 @@ uv run babeldoc --files example.pdf --files example2.pdf --openai --openai-model
|
|
|
161
161
|
- `--ocr-workaround`: Use OCR workaround (default: False). Only suitable for documents with black text on white background. When enabled, white rectangular blocks will be added below the translation to cover the original text content, and all text will be forced to black color.
|
|
162
162
|
- `--auto-enable-ocr-workaround`: Enable automatic OCR workaround (default: False). If a document is detected as heavily scanned, this will attempt to enable OCR processing and skip further scan detection. See "Important Interaction Note" below for crucial details on how this interacts with `--ocr-workaround` and `--skip-scanned-detection`.
|
|
163
163
|
- `--primary-font-family`: Override primary font family for translated text. Choices: 'serif' for serif fonts, 'sans-serif' for sans-serif fonts, 'script' for script/italic fonts. If not specified, uses automatic font selection based on original text properties.
|
|
164
|
+
- `--only-include-translated-page`: Only include translated pages in the output PDF. This option is only effective when `--pages` is used. (default: False)
|
|
164
165
|
|
|
165
166
|
- `--rpc-doclayout`: RPC service host address for document layout analysis (default: None)
|
|
166
167
|
- `--working-dir`: Working directory for translation. If not set, use temp directory.
|
|
@@ -269,6 +270,7 @@ disable-rich-text-translate = false
|
|
|
269
270
|
use-alternating-pages-dual = false
|
|
270
271
|
watermark-output-mode = "watermarked" # Choices: "watermarked", "no_watermark", "both"
|
|
271
272
|
max-pages-per-part = 50 # Automatically split the document for translation and merge it back.
|
|
273
|
+
only_include_translated_page = false # Only include translated pages in the output PDF. Effective only when `pages` is used.
|
|
272
274
|
# no-watermark = false # DEPRECATED: Use watermark-output-mode instead
|
|
273
275
|
skip-scanned-detection = false # Skip scanned document detection for faster processing
|
|
274
276
|
auto_extract_glossary = true # Set to false to disable automatic term extraction
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.71"
|
|
@@ -966,6 +966,22 @@ class PDFCreater:
|
|
|
966
966
|
self.restore_media_box(pdf, self.mediabox_data)
|
|
967
967
|
except Exception:
|
|
968
968
|
logger.exception("restore media box failed")
|
|
969
|
+
|
|
970
|
+
if translation_config.only_include_translated_page:
|
|
971
|
+
total_page = set(range(0, len(pdf)))
|
|
972
|
+
|
|
973
|
+
pages_to_translate = {
|
|
974
|
+
page.page_number
|
|
975
|
+
for page in self.docs.page
|
|
976
|
+
if self.translation_config.should_translate_page(
|
|
977
|
+
page.page_number + 1
|
|
978
|
+
)
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
should_removed_page = list(total_page - pages_to_translate)
|
|
982
|
+
|
|
983
|
+
pdf.delete_pages(should_removed_page)
|
|
984
|
+
|
|
969
985
|
with self.translation_config.progress_monitor.stage_start(
|
|
970
986
|
SAVE_PDF_STAGE_NAME,
|
|
971
987
|
2,
|
|
@@ -998,6 +1014,11 @@ class PDFCreater:
|
|
|
998
1014
|
)
|
|
999
1015
|
translation_config.raise_if_cancelled()
|
|
1000
1016
|
original_pdf = pymupdf.open(self.original_pdf_path)
|
|
1017
|
+
if (
|
|
1018
|
+
self.translation_config.only_include_translated_page
|
|
1019
|
+
and should_removed_page
|
|
1020
|
+
):
|
|
1021
|
+
original_pdf.delete_pages(should_removed_page)
|
|
1001
1022
|
translated_pdf = pdf
|
|
1002
1023
|
|
|
1003
1024
|
# Choose between alternating pages and side-by-side format
|
|
@@ -71,7 +71,9 @@ class DetectScannedFile:
|
|
|
71
71
|
contents_list = page.get_contents()
|
|
72
72
|
for index in contents_list:
|
|
73
73
|
contents = doc.xref_stream(index)
|
|
74
|
-
if regex.search(
|
|
74
|
+
if regex.search(
|
|
75
|
+
rb"(/Artifact|/P)(\s*\<\<\s*/MCID\s+|\s+BDC)", contents
|
|
76
|
+
):
|
|
75
77
|
hit_list[page.number] += 1
|
|
76
78
|
if regex.search(rb"\s3\s+Tr\s", contents):
|
|
77
79
|
hit_list[page.number] += 1
|
|
@@ -112,7 +114,7 @@ class DetectScannedFile:
|
|
|
112
114
|
non_scanned += 1
|
|
113
115
|
progress.advance(1)
|
|
114
116
|
|
|
115
|
-
if scanned
|
|
117
|
+
if scanned >= threshold:
|
|
116
118
|
if self.translation_config.auto_enable_ocr_workaround:
|
|
117
119
|
logger.warning(
|
|
118
120
|
f"Detected {scanned} scanned pages, which is more than 80% of the total pages. "
|
|
@@ -156,4 +158,5 @@ class DetectScannedFile:
|
|
|
156
158
|
)[:, :, ::-1]
|
|
157
159
|
before_page_image = cv2.cvtColor(before_page_image, cv2.COLOR_RGB2GRAY)
|
|
158
160
|
after_page_image = cv2.cvtColor(after_page_image, cv2.COLOR_RGB2GRAY)
|
|
159
|
-
|
|
161
|
+
similarity = structural_similarity(before_page_image, after_page_image)
|
|
162
|
+
return similarity > 0.95
|
|
@@ -398,6 +398,18 @@ class MemoryMonitor:
|
|
|
398
398
|
time.sleep(self.interval)
|
|
399
399
|
|
|
400
400
|
|
|
401
|
+
def fix_null_page_content(doc: Document) -> list[int]:
|
|
402
|
+
invalid_page = []
|
|
403
|
+
for x in range(len(doc)):
|
|
404
|
+
xref = doc[x].xref
|
|
405
|
+
if doc.xref_object(xref) == "null":
|
|
406
|
+
invalid_page.append(x)
|
|
407
|
+
for x in invalid_page:
|
|
408
|
+
doc.delete_page(x)
|
|
409
|
+
doc.insert_page(x)
|
|
410
|
+
return invalid_page
|
|
411
|
+
|
|
412
|
+
|
|
401
413
|
def fix_null_xref(doc: Document) -> None:
|
|
402
414
|
"""Fix null xref in PDF file by replacing them with empty arrays.
|
|
403
415
|
|
|
@@ -718,6 +730,7 @@ def _do_translate_single(
|
|
|
718
730
|
)
|
|
719
731
|
# Fix null xref in PDF file
|
|
720
732
|
try:
|
|
733
|
+
_ = fix_null_page_content(doc_input)
|
|
721
734
|
fix_filter(doc_input)
|
|
722
735
|
fix_null_xref(doc_input)
|
|
723
736
|
except Exception:
|
|
@@ -731,7 +744,9 @@ def _do_translate_single(
|
|
|
731
744
|
resfont = "china-ss"
|
|
732
745
|
|
|
733
746
|
# Fix null xref in PDF file
|
|
747
|
+
invalid_pages = []
|
|
734
748
|
try:
|
|
749
|
+
invalid_pages = fix_null_page_content(doc_pdf2zh)
|
|
735
750
|
fix_filter(doc_pdf2zh)
|
|
736
751
|
fix_null_xref(doc_pdf2zh)
|
|
737
752
|
except Exception:
|
|
@@ -21,7 +21,7 @@ from babeldoc.translation_config import TranslationConfig
|
|
|
21
21
|
from babeldoc.translation_config import WatermarkOutputMode
|
|
22
22
|
|
|
23
23
|
logger = logging.getLogger(__name__)
|
|
24
|
-
__version__ = "0.3.
|
|
24
|
+
__version__ = "0.3.71"
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
def create_parser():
|
|
@@ -261,6 +261,12 @@ def create_parser():
|
|
|
261
261
|
default=None,
|
|
262
262
|
help="Override primary font family for translated text. Choices: 'serif' for serif fonts, 'sans-serif' for sans-serif fonts, 'script' for script/italic fonts. If not specified, uses automatic font selection based on original text properties.",
|
|
263
263
|
)
|
|
264
|
+
translation_group.add_argument(
|
|
265
|
+
"--only-include-translated-page",
|
|
266
|
+
action="store_true",
|
|
267
|
+
default=False,
|
|
268
|
+
help="Only include translated pages in the output PDF. Effective only when --pages is used.",
|
|
269
|
+
)
|
|
264
270
|
# service option argument group
|
|
265
271
|
service_group = translation_group.add_mutually_exclusive_group()
|
|
266
272
|
service_group.add_argument(
|
|
@@ -483,6 +489,7 @@ async def main():
|
|
|
483
489
|
auto_extract_glossary=args.auto_extract_glossary,
|
|
484
490
|
auto_enable_ocr_workaround=args.auto_enable_ocr_workaround,
|
|
485
491
|
primary_font_family=args.primary_font_family,
|
|
492
|
+
only_include_translated_page=args.only_include_translated_page,
|
|
486
493
|
)
|
|
487
494
|
|
|
488
495
|
# Create progress handler
|
|
@@ -153,6 +153,7 @@ class TranslationConfig:
|
|
|
153
153
|
auto_extract_glossary: bool = True,
|
|
154
154
|
auto_enable_ocr_workaround: bool = False,
|
|
155
155
|
primary_font_family: str | None = None,
|
|
156
|
+
only_include_translated_page: bool | None = False,
|
|
156
157
|
):
|
|
157
158
|
self.translator = translator
|
|
158
159
|
initial_user_glossaries = list(glossaries) if glossaries else []
|
|
@@ -268,6 +269,11 @@ class TranslationConfig:
|
|
|
268
269
|
]
|
|
269
270
|
self.primary_font_family = primary_font_family
|
|
270
271
|
|
|
272
|
+
if only_include_translated_page is None:
|
|
273
|
+
only_include_translated_page = False
|
|
274
|
+
|
|
275
|
+
self.only_include_translated_page = only_include_translated_page
|
|
276
|
+
|
|
271
277
|
def parse_pages(self, pages_str: str | None) -> list[tuple[int, int]] | None:
|
|
272
278
|
"""解析页码字符串,返回页码范围列表
|
|
273
279
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "BabelDOC"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.71"
|
|
4
4
|
description = "Yet Another Document Translator"
|
|
5
5
|
license = "AGPL-3.0"
|
|
6
6
|
readme = "README.md"
|
|
@@ -154,7 +154,7 @@ pythonpath = [".", "src"]
|
|
|
154
154
|
testpaths = ["tests"]
|
|
155
155
|
|
|
156
156
|
[bumpver]
|
|
157
|
-
current_version = "0.3.
|
|
157
|
+
current_version = "0.3.71"
|
|
158
158
|
version_pattern = "MAJOR.MINOR.PATCH[.PYTAGNUM]"
|
|
159
159
|
|
|
160
160
|
[bumpver.file_patterns]
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.69"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/babeldoc_exception/BabelDOCException.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{babeldoc-0.3.69 → babeldoc-0.3.71}/babeldoc/document_il/utils/priority_thread_pool_executor.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|