Remove Ghostscript UserUnit warning
All supported Ghostscript versions have proper UserUnit support.
This commit is contained in:
@@ -185,15 +185,6 @@ def validate_pdfinfo_options(context: PdfContext) -> None:
|
||||
"Designer and can only be read by Adobe Acrobat or Adobe Reader."
|
||||
)
|
||||
raise InputFileError()
|
||||
if pdfinfo.has_userunit and options.output_type.startswith('pdfa'):
|
||||
log.error(
|
||||
"This input file uses a PDF feature that is not supported "
|
||||
"by Ghostscript, so you cannot use --output-type=pdfa for this "
|
||||
"file. (Specifically, it uses the PDF-1.6 /UserUnit feature to "
|
||||
"support very large or small page sizes, and Ghostscript cannot "
|
||||
"output these files.) Use --output-type=pdf instead."
|
||||
)
|
||||
raise InputFileError()
|
||||
if pdfinfo.has_acroform:
|
||||
if options.redo_ocr:
|
||||
log.error(
|
||||
|
||||
@@ -20,18 +20,13 @@ def poster(resources):
|
||||
return resources / 'poster.pdf'
|
||||
|
||||
|
||||
def test_userunit_ghostscript_fails(poster, no_outpdf, caplog):
|
||||
result = run_ocrmypdf_api(poster, no_outpdf, '--output-type=pdfa')
|
||||
assert result == ExitCode.input_file
|
||||
assert 'not supported by Ghostscript' in caplog.text
|
||||
|
||||
|
||||
def test_userunit_pdf_passes(poster, outpdf):
|
||||
@pytest.mark.parametrize("mode", ['pdf', 'pdfa'])
|
||||
def test_userunit_pdf_passes(mode, poster, outpdf):
|
||||
before = PdfInfo(poster)
|
||||
check_ocrmypdf(
|
||||
poster,
|
||||
outpdf,
|
||||
'--output-type=pdf',
|
||||
f'--output-type={mode}',
|
||||
'--plugin',
|
||||
'tests/plugins/tesseract_cache.py',
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user