How to extract QR code and barcode data from documents with AI
Leave feedback
On this page
Invoices, shipping labels, tickets and forms carry machine-readable codes precisely so a machine can read them. search_qr_codes and search_barcodes turn that into one tool call — locally, with no upload to a scanning service.
Note
The commands and config snippets on this page are for the .NET build of the server — the only platform available today. Installation and client setup: MCP server for .NET. Other platforms will expose the same tools with their own launch command; everything else on this page applies unchanged.
The prompt
Read the QR codes and barcodes in invoice.pdf and tell me what they contain.
Each result carries the decoded text, the page, and the position. The agent reports the values and can carry them into whatever comes next.
Filtering instead of dumping
Both tools take a text filter that returns only codes containing a given string:
Find the barcode that starts with SHIP and tell me which page it is on.
On a document with a dozen codes that is the difference between an answer and a wall of values.
Leave the images off
Both tools accept returnImage. Set it only when you genuinely need the graphic — the decoded text is what an agent reasons over, and base64 images make responses large and slow for no benefit.
A realistic pipeline
For every PDF in the folder, read the barcode, and give me a table of file name → barcode value → page.
The agent loops the folder, calls search_barcodes per file, and builds the table. That table is the join key between a pile of scanned documents and the records in your ERP, WMS, or case system — which is usually the actual goal.
Pair it with signing when documents flow both ways: read the incoming reference, do the work, then sign the outgoing document with a QR code carrying the new reference.
What it is not
Not OCR. These tools read code symbologies, not printed text. A scanned page with no code returns nothing — that is a correct answer, not a failure.
Not layout extraction. For pulling fields and tables out of documents, use the GroupDocs.Parser MCP server instead; this server reads signatures and codes.
Not a trust boundary. A decoded value is data supplied by whoever made the document. Report it, look it up, cross-check it — do not let an agent act on it unreviewed.
Evaluation limits bite here too
Only the first two pages are processed without a license, so a code on page 3 simply is not found. get_license_status before you trust an empty result.
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.