How to extract data from scanned Vietnamese PDFs, invoices and tables with AI without font errors

A detailed guide to reading scanned Vietnamese PDFs with AI using the right AI Mindset: how it works, a 4-step process, 3 practical prompt templates and safe verification principles.
How to extract data from scanned Vietnamese PDFs, invoices and tables with AI without font errors

Reading scanned Vietnamese PDFs with AI means combining optical character recognition (OCR) with large language models to accurately extract text, tables and data from image-based PDF files, especially Vietnamese text with diacritics. The right mindset is to understand AI’s limits, verify results proactively and design a suitable workflow instead of leaving everything to the tool.

Key Takeaways

  • Scanned Vietnamese PDFs often run into font errors because of the complex tone marks. Modern AI OCR handles them better than traditional OCR, but humans still need to verify the output.
  • The standard workflow has 4 steps: image preprocessing → OCR extraction → AI contextual correction → human confirmation of the final result.
  • Prompt engineering plays a key role: the clearer your prompt is about the data structure you want, the more accurate the extraction.
  • Always apply the human-in-the-loop principle and think about security before uploading sensitive documents to cloud AI platforms.

Part 1: Understanding the problem — why scanned Vietnamese PDFs are hard to read, and the right mindset before choosing a tool

What a scanned PDF really is

When you scan an invoice, a contract or a table, the scanner creates an image file packaged in PDF format. Unlike a “text-based” PDF (which has an underlying text layer), a scanned PDF contains only pixels. The computer doesn’t “see” letters, only light and dark dots. That’s why you can’t highlight, copy-paste or search the content of the file.

With Vietnamese, the challenge doubles. The tone mark system (sắc, huyền, hỏi, ngã, nặng), combined with circumflexes (â, ê, ô) and horns (ơ, ư), creates hundreds of character variants. Traditional OCR engines often confuse “ă” with “ả” or “ơ” with “o”, or drop tone marks entirely, producing output that is readable but meaningless.

The AI mindset: tools serve people, not the other way around

According to the AI Mindset (the right way of thinking about AI) philosophy, before asking “which tool should I use?”, you need to ask “what result do I need, and how much error can I accept?”. An accountant extracting figures from invoices needs near-perfect accuracy, which is completely different from digitizing an old book for reference.

The right mindset has three layers:

  • Layer 1 — Understand the limits: No AI is 100% accurate with every type of scan. Blurry images, skewed pages, multiple columns and nested tables are all challenges.
  • Layer 2 — Design the workflow: AI is one link in the processing chain, not a magic button.
  • Layer 3 — Verify systematically: Always include a human confirmation step before using the output for important decisions.
Workflow diagram for reading scanned Vietnamese PDFs with AI - How to extract data from scanned Vietnamese PDFs, invoices and tables with AI without font errors
Workflow diagram How to extract data from scanned Vietnamese PDFs invoices and tables with AI without font errors

Part 2: A 4-step practical workflow — from scanned file to clean data

Step 1: Preprocess the scan to improve input quality

Output quality depends directly on input quality. Before feeding a file into any AI tool, do the following:

  • Increase resolution: Make sure the scan is at least 300 DPI. If the image is low-resolution, use an upscaling tool such as waifu2x or the enhance feature in Adobe Acrobat.
  • Deskew: A scan tilted by 2–3 degrees can cause OCR to lose diacritics entirely. Use Python with the OpenCV library or an online tool to straighten it.
  • Increase contrast: Converting the image to black and white (binarization) helps OCR clearly separate characters from the background.
  • Split pages: If the file has many pages, split it into individual pages and process them one at a time to avoid overloading the tool’s memory.

Step 2: Extract text with AI-powered OCR

There are currently three main groups of solutions:

  • Group 1 — Cloud OCR: Google Cloud Vision API, Azure AI Document Intelligence, Amazon Textract. These services support Vietnamese well, and Azure Document Intelligence in particular can recognize complex tables.
  • Group 2 — Open-source OCR: Tesseract OCR (with the vie language pack), PaddleOCR, EasyOCR. Free, run offline, and suitable when sensitive data can’t be uploaded to the cloud.
  • Group 3 — Multimodal AI: GPT-4o, Claude (Anthropic), Gemini. These can take image/PDF files directly and “read” the content using their vision capabilities. This is a big step forward because the AI doesn’t just recognize characters, it also understands context.

Which group to choose depends on your security requirements, budget and processing volume. If you want to learn how to write effective prompts for these models, see What is prompt engineering? A guide to writing effective prompts from basic to advanced.

Step 3: Use AI to correct errors in context and structure the data

Raw OCR output usually contains scattered errors: wrong diacritics, missing characters, misread numbers. This is where large language models (LLMs) shine. You paste the raw text into ChatGPT, Claude or Gemini with a prompt asking it to:

  • Fix Vietnamese spelling errors based on context.
  • Structure the data as a table, JSON or CSV.
  • Extract specific fields (invoice number, date, total amount, tax ID).

Step 4: Human verification and confirmation (human-in-the-loop)

Compare the AI output with the original file, focusing especially on financial figures, proper names, tax IDs and dates. Flag the spots the AI marked as “uncertain” (if your prompt asked the AI to assess its own confidence). This step can’t be skipped in any workflow involving important data.

Part 3: 3 ready-to-use prompt templates for extracting data from scanned Vietnamese PDFs

Below are three prompt templates you can use directly with multimodal AI (GPT-4o, Claude, Gemini). Replace the variables in [square brackets] with your own details. Writing effective prompts is the foundation of prompt engineering, a core skill in the AI era.

Template 1: Extracting a VAT invoice

You are an expert in processing Vietnamese accounting documents. I am attaching a photo/scan of a VAT invoice (hóa đơn GTGT).

Extract the following fields accurately and return them as JSON:
- Invoice series (ký hiệu hóa đơn)
- Invoice number
- Issue date (format DD/MM/YYYY)
- Seller name
- Seller tax ID
- Buyer name
- Buyer tax ID
- List of goods/services (name, unit, quantity, unit price, amount)
- Subtotal
- VAT rate
- VAT amount
- Total payment
- Amount in words

Notes:
- If any character is unclear, write [unclear] instead of guessing.
- Keep the Vietnamese diacritics intact. Double-check easily confused characters: ă/ả, ơ/o, đ/d.
- Invoice type: [paper invoice / printed e-invoice]

Template 2: Extracting tables from a scanned report

I am attaching a scan of a report page containing [number] tables in Vietnamese.

Requirements:
1. Identify all the tables in the image.
2. For each table, extract the data as a Markdown table.
3. Keep the original column headers and units.
4. If a cell is blurry or unreadable, write [?] and explain why.
5. After each table, note the overall confidence level: High / Medium / Low.

Document context: [Financial report / Timesheet / Materials list / Other]
Purpose: [Import into Excel / Reconcile figures / Archive]

Template 3: Batch digitizing administrative documents

You are an assistant for digitizing Vietnamese administrative documents. I will send you [number] scanned pages of [document type: decision / official letter / minutes], one at a time.

For each page:
1. Extract the full text, preserving its structure (title, reference number, issue date, main content, signature).
2. Fix obvious OCR errors (for example: "Công hòa" → "Cộng hòa", "xã hôi" → "xã hội"), but list the corrections at the end.
3. Mark any obscured or blurry parts as [unclear].
4. Output the result in this format:
   --- PAGE [number] ---
   Reference number: ...
   Date: ...
   Issuing authority: ...
   Content: ...
   Corrections made: ...
   Unreadable parts: ...

Part 4: Comparison of AI tools for reading scanned Vietnamese PDFs

Criterion Google Cloud Vision Azure Document Intelligence Tesseract OCR (offline) GPT-4o / Claude (multimodal)
Support for Vietnamese diacritics Good Very good Fair to fairly good Good to very good
Table recognition Fairly good Very good (prebuilt model) Limited Good (needs a clear prompt)
Handling Vietnamese VAT invoices Needs customization Has a prebuilt invoice model Needs heavy customization Good with the right prompt
Data security Cloud (check the policy) Cloud (GDPR compliant) Runs locally — highly secure Cloud (data may be used for training)
Cost Pay per API call Pay per page processed Free Subscription plan or API
Implementation difficulty Medium (requires programming) Medium (SDK available) High (needs installation and tuning) Low (uses a chat interface)

If you want to build your own automated processing pipeline in code, check out What is vibe coding to see how AI can help you write code faster. For applications that need voice interaction to confirm extracted data, What is an AI voice agent is also a direction worth considering.

Part 5: 5 common mistakes, AI’s limits and how to verify results

Mistake 1: Trusting AI output completely without checking

Even GPT-4o or Claude can mistake “1” for “l” or “0” for “O”, or drop tone marks. With financial data, a single wrong digit can cause discrepancies of millions of dong. Always compare the output with the original file.

Mistake 2: Uploading sensitive documents to cloud AI without assessing the risks

Invoices contain tax IDs, contracts contain confidentiality clauses, payrolls contain personal information. Before uploading, check the platform’s data policy. If the data is sensitive, prefer offline solutions such as Tesseract or PaddleOCR.

Mistake 3: Skipping image preprocessing

Many people send blurry, skewed scans with hand shadows straight to the AI and are then disappointed with poor results. Spending 2–3 minutes fixing the image can raise accuracy from 70% to over 95%.

Mistake 4: Using prompts that are too generic

A prompt like “Read this file for me” produces much worse results than one that specifies the document type, the fields to extract, the output format and how to handle unclear text. This is why How to use Cursor AI for beginners and non-programmers emphasizes the importance of giving AI complete context.

Mistake 5: Trying to process a file that is too large in one go

Sending a 50-page PDF to ChatGPT all at once will make the AI “forget” the content of the first pages by the time it reaches the last ones. Split it into batches of 3–5 pages, process them in sequence and combine the results.

Human-in-the-loop in practice

Build a checklist to run after every extraction: (1) Do the totals add up? (2) Does the tax ID have exactly 10 or 13 digits? (3) Are the dates valid? (4) Are proper names capitalized correctly? This process doesn’t take much time but prevents serious errors.

Frequently asked questions (FAQ)

Can AI read low-quality scanned PDFs?

Yes, but accuracy drops significantly for files below 150 DPI or images that are blurry or smudged. You should preprocess them (increase resolution, increase contrast, deskew) before feeding them to the AI. For very poor files, the output is for reference only, and you must check everything manually.

Which tools are free and run offline for better security?

Tesseract OCR (developed by Google, open source) and PaddleOCR (developed by Baidu) are both free and run entirely on your own computer. PaddleOCR usually gives better Vietnamese results than Tesseract thanks to its deep learning model. Both require installing Python to use.

How do I extract complex tables (nested tables, merged cells) from a scanned file?

Azure Document Intelligence is currently the strongest solution for complex tables thanks to its prebuilt layout model. If you use multimodal AI such as GPT-4o, include a prompt that clearly describes the table structure you expect, and ask the AI to confirm the number of rows and columns before extracting the data.

Can reading scanned Vietnamese PDFs with AI fully replace manual data entry?

AI significantly cuts data entry time, from hours down to minutes, but it doesn’t fully replace humans at the verification stage. For important documents (invoices, contracts, legal records), the optimal workflow is for AI to extract a draft and for a human to confirm the final version. This is the core spirit of AI Mindset (the right way of thinking about AI): mastering technology rather than depending on it blindly.

Was this article helpful?

Learn AI Mindset researches and fact-checks every article so you can understand and use AI well. If this one was useful, you can support us voluntarily so we can keep writing more like it.

Completely optional. Every article stays free to read whether or not you support us.

Support Learn AI Mindset on Ko-fi
Previous Article

How F&B and retail owners use AI to analyze menus, respond to reviews, and retain customers

Next Article

How to fix ChatGPT or Claude cutting off answers and forgetting early instructions in long conversations