To extract invoice data from PDF, first find out which kind of PDF it is

Updated

PDF is a container rather than a format, and two documents that look identical on screen can behave completely differently when you try to read them. One carries a text layer produced by the supplier's system; the other is a photograph or scan wrapped in a PDF. Extraction from the first is close to reliable. From the second it is recognition, with all the usual caveats.

Telling them apart

Try to select the text on screen. If you can, the PDF carries a text layer and extraction can read it directly, including exact figures and line descriptions. If you cannot, it is an image and needs optical recognition, where accuracy depends on resolution, contrast and how straight the page was. This one check predicts most of your extraction quality.

Why the difference matters so much

A text-layer PDF gives exact characters, so amounts and references are read rather than inferred. An image PDF introduces a recognition step with its own error rate, concentrated exactly where you least want it: digits in amounts, and references with mixed letters and numbers. Where you can influence how suppliers send documents, this is the thing to ask for.

What to do about the image ones

Improve the input where you can: ask for emailed documents rather than scans, guide anybody photographing paper, and scan consistently at a sensible resolution. Then set confidence handling so doubtful fields reach a person. The gap between the two kinds of PDF narrows with input quality far more than with a change of software.

Questions people ask about extract invoice data from pdf

Can we ask suppliers to send a particular format?

You can ask, and many will, particularly larger suppliers whose systems generate PDFs anyway. It is a cheap request with a real effect on accuracy.

Does a text layer guarantee correct extraction?

It removes the recognition error. Working out which text is the total and which line belongs where is still interpretation, and line items remain the hard part.

What about password-protected PDFs?

They will block automated capture. Ask the supplier to stop, or handle them as a named manual exception rather than letting them fail silently.

Sources

Related answers

Start Threewayly ProKeep the match, not the spreadsheet