From d735791524e51b2d42c136a7c2fc02a3d7d3c3c3 Mon Sep 17 00:00:00 2001 From: 5HT2 Date: Sun, 31 Aug 2025 20:32:30 +0100 Subject: [PATCH] fix(src): Refactor `valid_part_conforms` for PDF/A compliance levels --- src/ocrmypdf/pdfa.py | 2 +- src/ocrmypdf/pluginspec.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ocrmypdf/pdfa.py b/src/ocrmypdf/pdfa.py index e759150e..10f8e224 100644 --- a/src/ocrmypdf/pdfa.py +++ b/src/ocrmypdf/pdfa.py @@ -120,7 +120,7 @@ def file_claims_pdfa(filename: Path): 'output': 'pdf', 'conformance': 'No PDF/A metadata in XMP', } - valid_part_conforms = {'1A', '1B', '2A', '2B', '2U', '3A', '3B', '3U'} + valid_part_conforms = {'1a', '1b', '2a', '2b', '2u', '3a', '3b', '3u'} conformance = f'PDF/A-{pdfmeta.pdfa_status}' pdfa_dict: dict[str, str | bool] = {} if pdfmeta.pdfa_status in valid_part_conforms: diff --git a/src/ocrmypdf/pluginspec.py b/src/ocrmypdf/pluginspec.py index 701e4c71..05d5a648 100644 --- a/src/ocrmypdf/pluginspec.py +++ b/src/ocrmypdf/pluginspec.py @@ -492,7 +492,7 @@ def generate_pdfa( pdf_version: The minimum PDF version that the output file should be. At its own discretion, the PDF/A generator may raise the version, but should not lower it. - pdfa_part: The desired PDF/A compliance level, such as ``'2B'``. + pdfa_part: The desired PDF/A compliance level, such as ``'2b'``. progressbar_class: The class of a progress bar, which must implement the ProgressBar protocol. If None, no progress is reported. stop_on_soft_error: If there is an "soft error" such that PDF/A generation