PDF/A is the archive flavour of PDF: it requires embedded fonts and forbids features that break over time. OCRmyPDF produces PDF/A by default, adding the OCR layer and the archive structure in one run. The OCRmyPDF cookbook shows the plain command and the –output-type options. This guide runs it on one scanned PDF.
Prerequisites
OCRmyPDF installed with Tesseract and Ghostscript or veraPDF for PDF/A conversion, and a scanned PDF. Work on a copy.
Steps
1. Check the OCRmyPDF version
Run ocrmypdf –version in a terminal. Expected result: a version number prints.
2. Run OCRmyPDF for PDF/A output
Run ocrmypdf –output-type pdfa input.pdf output.pdf. Expected result: output.pdf is created.
3. Check the output claims PDF/A
Open the document properties in a PDF reader and look for the PDF/A claim. Expected result: the properties name a PDF/A part, such as PDF/A-2b.
4. Test that the text is searchable
Search output.pdf for a word from the page. Expected result: the search returns a hit, proving the OCR layer is present.
Practice check: fictional two-page scan of a letter, PDF/A-2b output
The table below is fictional practice material. It lists the four checks for the PDF/A file.
| Check | Expected result |
|---|---|
| Version printed | A version number prints |
| Output file created | output.pdf exists |
| PDF/A claimed | PDF/A-2b in properties |
| Text searchable | harvest returns a hit |
Expected result. the PDF/A file is created, its properties claim PDF/A-2b, and the word harvest is searchable in it.
Limits
- A PDF/A claim in the properties is not a full validation; run veraPDF when the archive must pass a formal check.
- UNTESTED – no OCR tool or AI tool was run; all results above are expected results. The practice file is fictional.
Sources
- OCRmyPDF Cookbook – –sidecar writes OCR text to a companion file; –output-type pdfa/pdf picks the output; –optimize shrinks the file; –mode strip removes the text layer. Checked 2026-11-29.
- Apryse, How to Validate PDF/UA Compliance – PDF/UA-2, published in 2024, aligns accessibility requirements with PDF 2.0; veraPDF and PAC can verify compliance. Checked 2026-11-29.
