mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-07-30 15:08:10 -04:00
Ghostscript's PDF/A conversion re-embeds non-embedded CID (CJK) fonts by substituting a system font, which corrupts the character-to-Unicode mapping and silently destroys an existing text layer -- commonly the OCR layer Adobe Acrobat adds to scanned CJK documents. Detect non-embedded CID/Type0 fonts before conversion: with --output-type auto (the default) downgrade to a regular PDF and preserve the text layer; with an explicit --output-type pdfa* stop with an error rather than emit corrupted output. Simple non-embedded fonts (e.g. Latin) are left alone -- Ghostscript substitutes them without corrupting the text, and they are far too common to treat as conversion blockers. Use --output-type pdf to keep the existing text layer, or --force-ocr to rebuild it with embedded fonts.