Adds more documentation for OCR_PAGES and prevents using 0 for actual OCR (#5275)

This commit is contained in:
Trenton H 2024-01-06 09:06:41 -08:00 committed by GitHub
parent ee2bfe2350
commit 9043f45350
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -238,7 +238,7 @@ class RasterisedDocumentParser(DocumentParser):
ocrmypdf_args["rotate_pages"] = True
ocrmypdf_args["rotate_pages_threshold"] = self.settings.rotate_threshold
if self.settings.pages is not None:
if self.settings.pages is not None and self.settings.pages > 0:
ocrmypdf_args["pages"] = f"1-{self.settings.pages}"
else:
# sidecar is incompatible with pages