Table of Contents
To OCR scanned technical documents well, scan at 300 dpi or more, clean and straighten the pages, choose an engine that reads your languages and tables, treat P&IDs as drawings rather than text pages, and measure errors on a hand-checked sample. Keep every extracted value linked to its page image so engineers can verify it.
Key takeaways
- Tesseract works best on images of at least 300 dpi (Tesseract documentation), and US federal rules for digitising permanent records require 300 ppi for text and 400 ppi for drawings (36 CFR 1236.50).
- Tables and numerals are recurring failure points, especially in Arabic (Heakl et al., 2025), and they hold the values technicians act on.
- Vision-language models read Arabic better than classic engines on KITAB-Bench, but on degraded pages they can produce text that is not there (He et al., 2025).
- A P&ID is a drawing, not a page of text. In one published pipeline, digitising a test P&ID took about 2.4 hours on average, including about 78 minutes of manual work (Kim et al., 2022).
- Measure character error rate and exact-match accuracy on tags and values, on your own pages.
Why do scanned documents block an AI assistant?
A document assistant can only answer from text it can read. A scanned manual is a stack of images: search engines and language models see nothing in it until OCR turns the pixels into text. Our guide to RAG for maintenance manuals treats OCR as its own project for that reason.
Drawings add to the problem. The authors of one P&ID digitisation pipeline note that plants that have been operating for a long time keep their P&IDs in image format, which requires digitisation (Kim et al., 2022).
Some PDFs only look fine. Docling's documentation describes files whose text displays correctly but copies out as garbage, because a font does not map its glyphs to real characters; its replace_broken_text_layer option detects such pages and reads them with OCR instead (Docling documentation). Check the existing text layer before trusting it.
What scan quality does OCR need?
Resolution comes first. Tesseract's documentation states that it "works best on images which have a DPI of at least 300 dpi" (Tesseract documentation). For comparison, the US National Archives rule for digitising permanent paper records requires at least 300 ppi for text documents and 400 ppi for drawings, and more when the smallest significant detail is 1.0 mm or smaller (36 CFR 1236.50). It is a US rule, but a useful reference for drawings with small lettering.
Then prepare the image. The same Tesseract page lists the main fixes:
- Straighten the page so text lines are horizontal.
- Binarise carefully. Results can be poor when the page background is of uneven darkness. Tesseract 5 added the Adaptive Otsu and Sauvola binarisation methods.
- Remove noise such as speckles, because some noise survives binarisation and lowers accuracy.
- Keep a small border, around 10 pixels, and crop away large empty margins.
- Choose the right page segmentation mode. By default Tesseract expects a page of text; mode 11 looks for sparse text "in no particular order", which can help on drawings.
- Turn off the dictionary when most of the text is not dictionary words, such as part numbers and tags.
OCRmyPDF packages much of this for PDFs: it uses Tesseract, offers options such as deskew, and adds a searchable text layer to the scanned PDF, by default in the archival PDF/A format. Its documentation warns that results may be poor when a document contains languages not passed with -l, and that the PDF/A conversion may transcode images lossily, so keep the original scans.
Which OCR engine should you use?
As checked in November 2026, these are the common open options for on-premise use. Versions change fast; test on your own pages.
| Option | What it is | Strengths | Watch out for |
|---|---|---|---|
| Tesseract, often through OCRmyPDF | Classic engine with an LSTM line recogniser, Apache 2.0 licence | More than 100 languages; well documented | Known weakness on tables; needs good image preparation |
| PaddleOCR | Open-source OCR toolkit, Apache 2.0 licence | PP-OCRv5 multilingual models added Arabic; PP-StructureV3 converts pages to Markdown or JSON with table cell coordinates | Several model families and frequent releases; pin the version you validate |
| Docling | Document conversion framework that calls an OCR engine of your choice | One pipeline for documents and OCR; RapidOCR, EasyOCR, Tesseract and others; models can be prefetched for offline use | OCR quality is that of the engine you plug in |
| Vision-language models, such as PaddleOCR-VL | A multimodal model reads the page image and writes text or Markdown | Better than classic engines on Arabic in KITAB-Bench | Can write plausible text that is not on the page |
The last row deserves care. On KITAB-Bench, an Arabic OCR benchmark of 8,809 samples, modern vision-language models outperformed EasyOCR, PaddleOCR and Surya by an average of 60% in character error rate (Heakl et al., 2025). On a broader benchmark, most multimodal models scored below 50 out of 100, with weaknesses in fine-grained perception, layout perception and complex element parsing (Fu et al., OCRBench v2). On degraded documents, models often fail to perceive the degradation and rely on linguistic priors, which "frequently results in the generation of hallucinatory content" (He et al., 2025). The practical risk is a plausible but wrong value that nobody notices, so numbers from any engine need checking.
Why are tables, numbers and Arabic text the hard part?
Maintenance values live in tables: clearances, torques, set points, lubrication intervals. Tesseract's own documentation says "it is known tesseract has a problem to recognize text/data from tables" (Tesseract documentation). Use a layout-aware tool that returns the table structure, then check that each value sits in the right row and column.
For Arabic, the KITAB-Bench authors list numeral recognition errors, word elongation, complex fonts and table structure detection among the open problems, and the best model they tested reached only 65% accuracy converting Arabic PDFs to Markdown (Heakl et al., 2025). Pages that mix Arabic, French and English need all three languages loaded and careful handling of digits; our post on documents that mix Arabic, French and English covers that in detail.
How is a P&ID different from a page of text?
A P&ID has little running text. It has symbols for equipment, valves and instruments, lines for pipes and signals, and short labels, some of them rotated. Instrument symbols and their identification follow a standard such as ANSI/ISA-5.1-2024, or a company standard derived from it, so a tag such as FT-1001 carries meaning that plain OCR does not capture.
The authors of Digitize-PID list the obstacles: variation in scale, size and noise between drawings, the complexity and crowdedness of the sheets, and the domain knowledge needed to interpret them (Paliwal et al., 2021). Research pipelines therefore split the work into stages. In the pipeline of Kim et al. (2022):
| Stage | Method in the paper | Result on five test P&IDs |
|---|---|---|
| Symbol recognition | Deep learning detector, 76 symbol classes | 96.65% precision, 96.40% recall |
| Text recognition | CRAFT for detection, Tesseract for recognition | 90.65% precision, 92.16% recall |
| Line recognition | Detector for line signs and flow arrows, image processing for continuous lines | 95.25% precision, 87.91% recall |
| Topology reconstruction | Graph built from proximity and geometric rules | 99.56% precision, 96.07% recall |
| Digital P&ID generation | Output in the DEXPI data model | Attributes, border and title box entered by hand |
Even so, people stayed in the loop. Recognition errors were corrected by hand before the connections were rebuilt, and each test P&ID took 8,488 seconds on average, of which 4,654 seconds was manual work. Large symbols were often missed because the training data held few of them, and text was sometimes linked to the wrong object.
The output format matters as much as the recognition. DEXPI is an openly available data exchange standard for the process industry; its version 2.0 covers block flow diagrams, process flow diagrams and P&IDs, and the 2.0.1 fix release was published in September 2026. Digitising into a standard model like this, rather than into free text, lets the result feed engineering tools and not only search.
For most document assistants a simpler target is enough: extract the tags, line numbers and title block (drawing number, revision, date) as metadata, index them for exact search, and link each answer to the drawing image.
How do you measure OCR accuracy?
Character error rate (CER) counts the substitutions, deletions and insertions needed to turn the OCR output into the correct text, divided by the number of characters in the correct text. It can exceed 1 when there are many insertions (Hugging Face Evaluate, CER). CER suits prose. For technical documents, add exact-match accuracy on the fields people act on.
- Pick 30 to 50 pages per document family: typed manuals, tables, datasheets, handwritten logs, drawings.
- Type the correct text by hand, including every tag, part number and value.
- Run each candidate engine and settings combination on the same pages.
- Compute CER per family, and the share of tags and values read exactly right.
- Look at the errors: a swapped decimal separator, an O read as 0 in a tag, a value shifted to the next table row.
- Set acceptance levels per family and decide which pages need human review.
- Re-run the sample whenever you change scanner settings, engine, model or version.
Then test the whole assistant, as in our guide to evaluating an LLM on your own documents: a wrong answer may come from OCR, retrieval or the model.
Where should the OCR run?
On your own infrastructure, if the documents are confidential. Every option in the table above can run locally, and Docling documents how to prefetch its OCR models for offline use (Docling documentation). For sites without internet access, see air-gapped AI deployment.
Inspection reports and shift logs often contain personal data such as technicians' names. In Algeria, Law 18-07 of 10 June 2018, amended by Law 25-11 of 24 July 2025, governs processing of personal data; according to law firm Gide, processing must be notified in advance to the national authority (ANPDP), and transfers of personal data abroad generally require its prior authorisation (Gide). Sending scans to a foreign cloud OCR service raises that question. Confirm how the law applies to your documents with counsel.
What we have seen at KABAS AI
DALILE, our AI knowledge assistant, reads technical documents, spreadsheets and databases, answers with exact sources, and runs offline on the client's own servers. Like any document assistant, it is only as good as the text it receives, so we advise assessing scanned archives first. ADFC (Sonatrach Group), which uses our Virtual Lab, is exploring integration with DALILE for knowledge discovery, literature review and technical documentation (ADFC case study).
Our practical advice:
- Inventory first. Count pages by family and by language, and note which ones are scans, which have a text layer, and which are drawings.
- Start with the documents people ask about most, not the whole archive.
- Route by document type. Typed prose, tables and drawings need different settings, and sometimes different engines.
- Keep a human check on safety-relevant values, as described in our post on human-in-the-loop AI.
Our agentic AI service deploys DALILE and connects it to your document management systems and databases.
Sources
- Tesseract documentation, Improving the quality of the output
- Tesseract OCR on GitHub
- US Code of Federal Regulations, 36 CFR 1236.50, Digitizing permanent paper records (Cornell LII)
- OCRmyPDF documentation, Introduction
- PaddleOCR on GitHub
- Docling documentation, OCR
- Heakl et al., KITAB-Bench: A Comprehensive Multi-Domain Benchmark for Arabic OCR and Document Understanding (arXiv 2502.14949, 2025)
- Fu et al., OCRBench v2: An Improved Benchmark for Evaluating Large Multimodal Models on Visual Text Localization and Reasoning (arXiv 2501.00321)
- He et al., Seeing is Believing? Mitigating OCR Hallucinations in Multimodal Large Language Models (arXiv 2506.20168, 2025)
- Paliwal et al., Digitize-PID: Automatic Digitization of Piping and Instrumentation Diagrams (arXiv 2109.03794, 2021)
- Kim et al., End-to-end digitization of image format piping and instrumentation diagrams at an industrially applicable level, Journal of Computational Design and Engineering 9(4), 2022
- ISA, ISA-5 standards: ANSI/ISA-5.1-2024, Instrumentation and Control Symbols and Identification
- DEXPI, Specifications
- Hugging Face Evaluate, Character error rate (CER)
- Gide, Protection of personal data: focus on Algerian regulations
Frequently asked questions
At what resolution should we scan technical documents?
Tesseract's documentation says it works best on images of at least 300 dpi. US federal rules for digitising permanent records set 300 ppi for text documents and 400 ppi for drawings, with higher resolution when the smallest detail is 1 mm or less. Test a sample of your own pages before scanning a whole archive.
Can OCR digitise a P&ID automatically?
Partly. Research pipelines detect symbols, text and lines and rebuild the connections between them, but they still need people. In one published end-to-end pipeline, each test P&ID took about 2.4 hours on average, of which about 78 minutes was manual work such as correcting recognition errors and entering attributes.
Are vision-language models better than classic OCR engines?
On Arabic, the KITAB-Bench authors found that vision-language models beat traditional OCR tools by an average of 60% in character error rate. They can also produce plausible text that is not on a degraded page. Compare both kinds on your own pages and check numbers and tags by hand.
How do we know if our OCR is good enough?
Type the correct text for a sample of pages by hand, then compute the character error rate and the share of tags, part numbers and values read exactly right. Set the acceptance level per document type, because a small error rate on prose can still mean a wrong value in a torque table.
Does OCR have to run in the cloud?
No. Open-source engines such as Tesseract and PaddleOCR run on your own servers, and Docling can download its OCR models in advance for offline use. Running OCR locally keeps confidential drawings and reports, and any personal data in them, on your own infrastructure.
Should we keep the scanned images after OCR?
Yes. The image is the reference and the extracted text is a derived copy that may contain errors. Tools such as OCRmyPDF add a searchable text layer to the scanned PDF instead of replacing it, and a document assistant should link every passage it cites to its page image.



