ocrmypdf TypeError: ожидаемая строка или байтовый объект

После выполнения brew install ocrmypdf я пытаюсь запустить ocrmypdf из z-оболочки Mac, но получаю сообщение об ошибке ниже. Любые идеи очень ценятся!

$ ocrmypdf --force-ocr Ritter_102318.pdf Ritter_redo.pdf
Scanning contents: 100%|████████████████████████| 7/7 [00:00<00:00, 12.96page/s]
Start processing 4 pages concurrently
    7 [tesseract] lots of diacritics - possibly poor OCR
OCR: 100%|██████████████████████████████████| 7.0/7.0 [00:16<00:00,  2.33s/page]
An exception occurred while executing the pipeline
Traceback (most recent call last):
  File "/usr/local/Cellar/ocrmypdf/10.3.3/libexec/lib/python3.8/site-packages/ocrmypdf/_sync.py", line 367, in run_pipeline
    exec_concurrent(context)
  File "/usr/local/Cellar/ocrmypdf/10.3.3/libexec/lib/python3.8/site-packages/ocrmypdf/_sync.py", line 301, in exec_concurrent
    pdf = post_process(pdf, context)
  File "/usr/local/Cellar/ocrmypdf/10.3.3/libexec/lib/python3.8/site-packages/ocrmypdf/_sync.py", line 241, in post_process
    pdf_out = metadata_fixup(pdf_out, context)
  File "/usr/local/Cellar/ocrmypdf/10.3.3/libexec/lib/python3.8/site-packages/ocrmypdf/_pipeline.py", line 768, in metadata_fixup
    del meta['dc:title']
  File "/usr/local/Cellar/ocrmypdf/10.3.3/libexec/lib/python3.8/site-packages/pikepdf/models/metadata.py", line 391, in __exit__
    self._apply_changes()
  File "/usr/local/Cellar/ocrmypdf/10.3.3/libexec/lib/python3.8/site-packages/pikepdf/models/metadata.py", line 463, in _apply_changes
    self._update_docinfo()
  File "/usr/local/Cellar/ocrmypdf/10.3.3/libexec/lib/python3.8/site-packages/pikepdf/models/metadata.py", line 431, in _update_docinfo
    value = re_xml_illegal_chars.sub('', value)
TypeError: expected string or bytes-like object

0 ответов

Другие вопросы по тегам