Improve help text about aborting due to text

This commit is contained in:
James R. Barlow
2020-04-15 02:17:55 -07:00
parent 2155bcacb4
commit 9e3e4f2687
2 changed files with 8 additions and 1 deletions
+6
View File
@@ -22,6 +22,12 @@ As the error message suggests, your options are:
- ``ocrmypdf --skip-text`` to skip OCR and other processing on any
pages that contain text. Text pages will be copied into the output
PDF without modification.
- ``ocrmypdf --redo-ocr`` to scan the file for any existing OCR
(non-printing text), remove it, and do OCR again. This is one way
to take advantage of improvements in OCR accuracy. Printable vector
text is excluded from OCR, so this can be used on files that contain
a mix of digital and scanned files.
Input file 'filename' is not a valid PDF
========================================
+2 -1
View File
@@ -252,7 +252,8 @@ def is_ocr_required(page_context):
elif pageinfo.has_text:
if not options.force_ocr and not (options.skip_text or options.redo_ocr):
raise PriorOcrFoundError(
"page already has text! - aborting (use --force-ocr to force OCR)"
"page already has text! - aborting (use --force-ocr to force OCR; "
" see also help for the arguments --skip-text and --redo-ocr"
)
elif options.force_ocr:
log.info("page already has text! - rasterizing text and running OCR anyway")