mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-01-06 12:11:18 +00:00
Trap PDF/A-3 errors on old Ghostscript
This commit is contained in:
parent
5c8a007f3e
commit
9226f8a5d1
@ -398,6 +398,11 @@ def check_options_output(options, log):
|
||||
if options.output_type == 'pdfa':
|
||||
options.output_type = 'pdfa-2'
|
||||
|
||||
if options.output_type == 'pdfa-3' and ghostscript.version() < '9.19':
|
||||
raise MissingDependencyError(
|
||||
"--output-type pdfa-3 requires Ghostscript 9.19 or later"
|
||||
)
|
||||
|
||||
lossless_reconstruction = False
|
||||
if options.pdf_renderer in ('hocr', 'sandwich'):
|
||||
if not any((options.deskew, options.clean_final, options.force_ocr,
|
||||
|
||||
@ -953,6 +953,9 @@ def test_sidecar_nonempty(spoof_tesseract_cache, resources, outpdf):
|
||||
|
||||
@pytest.mark.parametrize('pdfa_level', ['1', '2', '3'])
|
||||
def test_pdfa_n(spoof_tesseract_cache, pdfa_level, resources, outpdf):
|
||||
if pdfa_level == '3' and ghostscript.version() < '9.19':
|
||||
pytest.xfail(reason='Ghostscript >= 9.19 required')
|
||||
|
||||
check_ocrmypdf(
|
||||
resources / 'ccitt.pdf', outpdf,
|
||||
'--output-type', 'pdfa-' + pdfa_level,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user