When you need to read pdf fields to process them (ie invoices), how do you choose the solution?

Hello

I have invoices to read with different formats, how do I know whether to use

  • read pdf and extract fields through regex rules
  • document understanding (is this the same as IXP?)
  • gen AI activities

Also, how does AI units consumption work in these cases?

Appreciate any inputs

Thanks

Hi @adext01

Regex is recommended when the invoice layout is fixed and fields appear in consistent patterns.
Document Understanding is recommended when invoice formats vary and you need OCR plus ML‑based extraction for structured results.
Generative AI is recommended when documents are highly unstructured or when you need fast extraction without model training.
Regex uses no AI Units, Document Understanding uses AI Units for OCR and ML Extractor, and Generative AI uses AI Units based on token consumption.

Happy Automation

hello @adext01,

Here’s the approach we have folllowed-

If there are only few file formats which you have already identified - so you have pre-defined scope. And this is important; each attribute will need to have a standard or consistent (at least group of keywords) labels or consistent format for each data attribute (to use in your regex or script for matching)

Then go for Option 1 -

  • Read PDF (if scanned copy uses tesseract) and apply regex
  • To make it more scalable - use python script to match keywords (you can also use mapping table or excel file to map the group of key word with one attributes) - this way you don’t have change to workflow and you can call the script using arguments ( attributes and group of keywords).
  • Zero AI Units
  1. You have high variability, semi structured (Types of files -100 -200 and more) - so this is semi defined scope.
    Use Document Understanding - you can employ ML Models (Pre- trained for specific documents like invoices and others, it can identify the data regardless of position.

Here we can two steps - classification of the document (Determine the document type) and then extraction.

But for custom documents, you would have to train a ML Model on sample documents or old similar documents (at least 50-100 documents of each type)

AI Unit: Depends on classification type (1-25 page ~0 units for any classifier), ML Extractor is 1 per processed page

IXP and DU are related. DU is framework within UiPath that combines OCR, Classification, and ML Extraction. IXP is new Unified engine that powers DU and others like Communication mining. You use DU in studio, but it uses IXP behind the scenes.

  1. This is the final solution - Use GEN AI extractor for Unstructured documents (this includes scanned and handwritten). It is powerful engine which read the PDF and give output with reasoning.
    Efforts: You would have just have to fine tune the prompt for each attribute.
    AI Units: 1.2 AI Unit per page. (Digitization + Extractor)

Here is detailed AI Units overview-

AI Center - AI Units

Hope it helps!

veyr helpful thank you
i should go with option 1 even if i have let’s say 5 types of invoices ? with all different but stable formats

You’re welcome!

Yes, if there are only five types of invoices with standard format (labels and data attributes formats remain same all the time). I would say Option-1 would be sufficient to build a robust workflow.

Hello @adext01,

There has been a change in AI unit consumption. For a more detailed understanding of the consumption model, please talk to your Customer Success Manager (CSM) at UiPath, as they can provide you with a detailed consumption matrix.

At a high level, you can find some license consumption details here: https://licensing.uipath.com/

Thanks,
Karthik

When I need to read and process PDF fields such as invoices, my solution choice in UiPath depends mainly on how predictable the document structure is.

If the invoice formats are known, limited in number, and consistent, I avoid AI-based approaches and use core UiPath activities instead. The workflow typically starts with Read PDF Text for digital PDFs or Read PDF With OCR for scanned files. Once the text is extracted, I rely on string manipulation, and regular expressions to locate and capture required fields such as invoice number, date, and totals.

To keep the process maintainable, I design the logic so that:

  • Keywords and labels are stored in a configuration file or Excel mapping
  • Each invoice type follows a dedicated validation or extraction flow
  • Regex patterns are optimized per document type rather than generalized

This approach allows full control over extraction logic, avoids unpredictable behavior, and works efficiently when formats do not change often. It also removes dependency on AI Units and external services, which is important in cost‑sensitive or restricted environments.

I consider AI-based or Document Understanding solutions only when invoice formats are highly variable or frequently changing. Otherwise, for stable layouts, UiPath’s standard PDF, OCR, and string-handling activities provide a reliable, faster, and easier-to-support solution.