From 23c95e966011580398ecdd2bbae748693af03e2c Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Thu, 10 Nov 2016 14:48:02 -0800 Subject: [PATCH] ghostscript: elide overprinting to fix PDF/A errors in GS 9.20 It looks like GS 9.19 can incorrectly set overprinting for the text layer even though this makes no sense in PDF/A, or at least someone produced PDFs that have this after a Tesseract PDF -> GS PDF/A conversion. GS 9.20 complains about this. Instead of aborting, elide the feature. See http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=094d5a1880f1cb9ed320ca9353eb69436e09b594 and issue #107. It looks like it is better to elide features and warn about elision rather than abort with an error. --- ocrmypdf/ghostscript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ocrmypdf/ghostscript.py b/ocrmypdf/ghostscript.py index 39640c77..fb58c9e6 100644 --- a/ocrmypdf/ghostscript.py +++ b/ocrmypdf/ghostscript.py @@ -56,7 +56,7 @@ def generate_pdfa(pdf_pages, output_file, threads=1): "-sProcessColorModel=DeviceRGB", "-dJPEGQ=95", "-dPDFA=2", - "-sPDFACompatibilityPolicy=2", + "-sPDFACompatibilityPolicy=1", "-sOutputFile=" + gs_pdf.name, ] args_gs.extend(pdf_pages)