James R. Barlow and aider
28d6ea0f10
feat: Add CLI generation methods to plugin option models
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
b7640bdb9c
feat: implement plugin option models with backward compatibility
...
This commit introduces Pydantic models for plugin-specific options in OCRmyPDF, focusing on:
- Creating TesseractOptions, OptimizeOptions, and GhostscriptOptions
- Adding backward compatibility properties
- Maintaining existing CLI and API functionality
- Preparing for future plugin option registration system
The changes include:
- Added type-annotated option models with validation
- Updated OCROptions to include legacy fields
- Added backward compatibility properties for jbig2 options
- Prepared groundwork for dynamic plugin option handling
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
62ad37b276
refactor: centralize plugin manager setup
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow
e4fa9dbc8f
Drop obsolete subclass of ArgumentParser
2025-12-21 12:21:48 -08:00
James R. Barlow
b7737446e4
cli: push up imports
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
4ed0e4510c
fix: add type checking imports for OCROptions and pluggy
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
James R. Barlow and aider
4f9c4c3e52
refactor: reorganize CLI and options initialization
...
Co-authored-by: aider (openrouter/anthropic/claude-sonnet-4) <aider@aider.chat >
2025-12-21 12:21:48 -08:00
5HT2
a7b0c0df6c
fix(src): Refactor CLI help references to PDF/A compliance levels
...
Please see [RFC8118 4.](https://datatracker.ietf.org/doc/html/rfc8118#section-4 ) for examples regarding the PDF/A compliance naming scheme.
Please see [RFC8118 [ISOPDFA]](https://datatracker.ietf.org/doc/html/rfc8118#ref-ISOPDFA ) for more complete information regarding the PDF/A compliance naming scheme.
2025-08-31 20:37:41 +01:00
James R. Barlow
944d99bdc1
Fix PROGRAM_NAME
2024-08-31 01:23:55 -07:00
James R. Barlow
26432c38a9
Raise exception if rotate pages threshold adjusted without --rotate-pages
...
Fixes Make usage of --rotate-pages-threshold clearer #1309
2024-05-18 23:49:27 -07:00
James R. Barlow
8a747f005a
pixels -> megapixels
...
Fixes #1265
2024-02-29 15:31:07 -08:00
James R. Barlow
6a746a1cbb
ruff linting/Python 3.10 cleanup
2024-02-14 12:41:51 -08:00
James R. Barlow
5b5827983b
Tweak documentation of --output-type
2023-10-26 23:57:08 -07:00
James R. Barlow
113a6b45bd
ruff autofixes (mostly typing.* -> collections.abc.*)
2023-10-01 00:02:53 -07:00
James R. Barlow
47b0f28564
Minor documentation and typing fixes
2023-09-25 00:19:48 -07:00
James R. Barlow
1768a1eda9
Improve documentation for large image downsampling
2023-09-20 16:58:59 -07:00
James R. Barlow
b2cbbf0099
Migrate --pdfa-image-compression argument to being managed by Ghostscript plugin
2023-09-20 15:20:42 -07:00
James R. Barlow
a6ce35b13a
Add argument to override digital signatures
2023-08-12 01:31:36 -07:00
Abe
59fd0ac587
Fix randomly ordered languages from set()
2023-06-16 22:14:40 +02:00
James R. Barlow
e8ed510543
Add stop on soft render errors and option to override
2023-06-01 23:49:34 -07:00
James R. Barlow
33b70be7d5
ruff: more fixes, mainly missing docstrings
2023-04-14 02:16:38 -07:00
James R. Barlow
9b8d14d16e
Accept most of ruff's delinting
2023-04-14 00:45:34 -07:00
James R. Barlow
80ed2117cc
Change to SPDX license tracking
2022-07-28 01:10:07 -07:00
James R. Barlow
dc6f1a266a
Modernize type annotations
2022-07-23 00:39:24 -07:00
James R. Barlow
61069660a2
Move optimization options to plugin
2022-06-12 02:42:16 -07:00
James R. Barlow
31683530f8
api/cli: replace private variable access with method
2022-06-12 00:31:01 -07:00
James R. Barlow
b17fb61389
Configure pylint in pyproject and delint
2022-06-12 00:30:44 -07:00
James R. Barlow
8182fe9c92
Make --use-threads default and update release notes
...
Re: issue Hanging on Random Files #814
2022-03-13 00:37:06 -08:00
Krasimir Nedelchev and GitHub
aed955ca8c
Fix typo ( #882 )
2021-12-27 15:36:19 -08:00
James R. Barlow
f91faf9795
Add new argument --tesseract-thresholding to control tesseract thresholding where available
...
Also add missing test for --tesseract-oem
2021-12-06 15:38:14 -08:00
James R. Barlow
4634b20de5
Raise max-image-mpixels again
...
PDFs are quite likely to have a lot of pixels, e.g. large high resolution scans.
250 MP is a page of A0 sized paper scanned at 400 DPI,
should be enough in most cases.
2021-11-14 15:47:39 -08:00
James R. Barlow
30440104ba
Remove --threshold argument
...
Tesseract is now included better thresholding (binarization) in v5. Users that have
thresholding issues should try that first. If we find further problems
this can be brought back as a plugin.
2021-11-12 20:09:55 -08:00
James R. Barlow
790d3022f6
Implement --output-type=none to skip producing the PDF and use only the sidecar
...
Closes #787
2021-09-26 01:07:34 -07:00
James R. Barlow
45736b7c2b
cli: clarify text to more accurately describe behavior of --jbig2-lossy
2021-09-16 16:03:39 -07:00
James R. Barlow
e402d5cb4b
typing: fix path and numeric issues
2021-08-27 00:23:38 -07:00
James R. Barlow
4eca0a165b
pre-commit: pyupgrade modernizing
2021-08-26 18:04:38 -07:00
James R. Barlow
079c162a96
Ensure sidecar is not input or output file
2021-03-05 00:29:42 -08:00
James R. Barlow
156d5d9a9c
cli: typing
2020-12-11 14:14:21 -08:00
James R. Barlow
68a57a7839
Add feature to generate hocr-pdf with visible debug text
2020-12-04 17:38:48 -08:00
James R. Barlow
aa0ec40102
Change license of all GPLv3 files to MPL-2.0
...
https://github.com/jbarlow83/OCRmyPDF/issues/600
2020-08-05 00:44:42 -07:00
James R. Barlow
190294634c
docs: edit plugins
2020-07-03 16:16:01 -07:00
James R. Barlow
393c5a9ea4
Fix error on -l lang1+lang2
2020-06-12 12:10:29 -07:00
James R. Barlow
aa060db5bc
Refactor tesseract_env variable into the plugin
...
Removed all cases except one in api.py, which isn't worth solving because
it should be removed anyway.
This also fixes a logic error in the OMP_THREAD_LIMIT decision, api.py
did not use pass kwargs correctly so they never worked before.
2020-05-26 02:14:06 -07:00
James R. Barlow
d43212d30b
Refactor --language argument into set
2020-05-25 03:20:10 -07:00
James R. Barlow
9bccff4f88
Move Tesseract specific arguments to plugin
2020-05-16 03:24:31 -07:00
James R. Barlow
4b986a5943
cli: make ArgumentParser._api_mode private
2020-05-12 01:28:36 -07:00
James R. Barlow
32759c9025
Change argument from --plugins to --plugin
2020-05-06 00:43:40 -07:00
James R. Barlow
e02f6c1e97
Support plugin invocation with API
2020-05-02 03:34:31 -07:00
James R. Barlow
23d558ad8c
Allow plugins to add command line arguments
2020-05-02 01:37:24 -07:00
James R. Barlow
82bce463ae
Start pluggy-based plugin system
2020-05-01 02:15:23 -07:00