IRONSOFTWAREHOME

How to Use IronOCR with Google Antigravity

Curtis Chau
Curtis Chau
Updated: October 9, 2026

Many AI coding tools stop at code compilation and leave you to verify that the code works. In OCR, this gap can be costly. For example, an invoice importer may build and populate a database without errors, yet a quarter of the totals may contain misread digits, which the build output will not reveal.

Google Antigravity operates through agents that return work for your review. IronOCR extracts text, barcodes, and tables from images and PDFs locally in .NET. When the agent manages test pages, it knows their contents, reads each page with IronOCR, compares extracted values to known values, and iterates until they match.

This article covers AI coding tools that help you build software on IronOCR. IronOCR's own machine learning features for photographs and handwriting are a separate subject, with their own photo reading guide and handwriting guide.

Quickstart
NuGetInstall with NuGet

PM > Install-Package IronOcr

Install IronOCR by running the command above in the NuGet Package Manager Console, or search for the package in the NuGet Package Manager.

Open your project in Antigravity and specify the expected output.

/plan In this C# project, add IronOCR (the IronOcr NuGet package, namespace
IronOcr) and read the German invoice at TestData/rechnung.png, printing its text
and overall confidence. Only English ships with the package, so add whatever
German needs and tell me which package that was. Read the license key from the
IRONOCR_LICENSE_KEY environment variable, never hardcode it. Run dotnet build,
fix any errors, and show me the output.
Text

The plan should name IronOcr.Languages.German and the language assignment, and omitting either is an error. Without the language pack, the first read throws a LanguagePackException, so the mistake shows up at once.

The license key guide details all locations IronOCR checks for a key.



What is Google Antigravity, and how is it different from a chat tool?

Given a goal, an Antigravity agent produces a plan, carries it out in the editor, the terminal, and a browser, and reports what it did in Artifacts you can review rather than a chat transcript.

Without guidance, an agent building a capture pipeline may pick the first OCR approach it finds or guess a package name. A guessed name can resolve to a counterfeit that an attacker published under that name in advance, a practice known as slopsquatting. Use IronOcr for Windows and IronOcr.Linux for Linux.

The AI coding assistants guide lists the IronOCR documentation links to give the agent and includes a single-prompt acceptance test you can run in Antigravity.

What does the agent hand back, and how do you review it?

Before the code, the Implementation Plan

The plan defines the files, language selection, filters, and target fields. Review it to confirm the scope.

During the run, the code diff

The code diff shows how the plan is implemented. Verify that the reader loads the specified pages, that promised filters are applied, and that every member used is present in the API reference.

After the run, the Walkthrough

The Walkthrough concludes the task by summarizing changes and providing evidence of results.

Where does the proof come from?

/browser Services/CaptureService.cs extracts delivery note numbers and totals
from uploads to POST /capture.

1. Run the API and upload TestData/known/invoice-01.png in the browser.
   Capture a screenshot.
2. Upload every file in TestData/known/ and record the delivery note number
   and total returned.
3. Include the five rotated or noisy scans in that folder.
4. Report a table of file, expected delivery note number, number returned,
   expected total, total returned, confidence, and match.
5. If any row does not match, explain the cause before changing anything, fix
   it in CaptureService.cs, and run the whole table again. Attach the table
   and the screenshots as Artifacts.
Text

Repeating the entire table afterward confirms that a filter added for one scan has not broken others.

From the CLI, the /browser command started a Chrome subagent.

Please note: Review the screenshot and any browser recording generated by Antigravity. If the agent skipped the upload form, it did not test the user workflow.

To flag a misread, such as a total with a transposed digit, comment on the screenshot.

What causes wrong or missing OCR values?

Most mismatches have a few common causes. Name the suspected cause and the agent skips the trial and error.

  • Wrong digits on rotated or noisy pages usually call for Deskew and DeNoise.
  • A read that returns text but no barcodes needs Configuration.ReadBarCodes turned on.
  • When ConvertToSearchablePdf throws on a scan, call SaveAsSearchablePdf on the read result instead.

How do you set up a project Antigravity can work in?

Provide the agent with a project that compiles. Otherwise, the agent spends its time on build errors.

Delegate installation to the agent.

Add the IronOcr NuGet package to this project. Then tell me which version was
installed and show me the PackageReference line. Configure the license key to
be read from the IRONOCR_LICENSE_KEY environment variable or a config file
rather than hardcoded, and add that config file to .gitignore if it isn't
already. Don't change other package references.
Text

Use the reported version number in all subsequent tasks.

Add a standing instructions file, AGENTS.md or GEMINI.md, to the repository root early in the project. Record that OCR uses IronOCR.

/learn The repository already carries an AGENTS.md from the ChatGPT Codex
setup, and this platform reads the same file. Extend its OCR section with the
rules this platform adds. Produce an Implementation Plan before any file is
edited. Attach the evidence to the Walkthrough rather than describing it. And
treat no task as finished until every page read is checked against a known
value.
Text

In our run, the agent added the three rules to the existing instructions file.

How do you delegate extraction and migration work?

When you require field extraction, specify the relevant pages and the files the reader belongs in.

Show me the Implementation Plan before any file is written. Then create
Services/DeliveryNoteReader.cs with a method that takes the path of a scanned
PDF, reads it with IronTesseract, and returns the amount on the line
containing Total due with that line's confidence, or null if the line is
missing. Create Services/SearchablePdf.cs with a method that writes a
searchable copy of a scanned PDF. Build, then prove ten sample invoices return
their known totals.
Text

In our test, the reader loaded each scan as a PDF input and searched every page's lines for the Total due line.

Migrations are well-suited for delegation, as they are lengthy, repetitive, and prone to overlooked edge cases. Point the agent at the current source code.

/plan Read Capture/LegacyCaptureService.cs. It reads scans with another OCR
library.

1. List every read it performs, with the settings it uses.
2. Map each setting to its IronOCR equivalent, citing the documentation page.
3. Produce this as a plan Artifact. Do not write code yet.
Text

The desktop app holds the plan for your review. From the CLI, review the diff after a plan task.

Any mapping without a supporting link should be reviewed more closely. The image input guide and PDF input guide address loading, while the results guide explains the output.

When should you dispatch more than one agent?

OCR migrations can be divided into two parallel tasks.

Agent A: migrate Capture/LegacyCaptureService.cs to IronOCR per the approved
plan. Keep the public method signatures unchanged.

Agent B: write xUnit tests for the migrated service. Assert that every page in
TestData/known/ returns its expected delivery note number and total, that
barcodes are returned when enabled, that a page without a total returns null,
and that reads below 80 confidence are flagged. Do not assert on full page
text.
Text
Please note: When running two agents in the desktop app, compare their Walkthroughs. Tests from the second agent are only valid if they run against the code the first agent produced. Also, verify how the confidence test obtains its low reading. In our test, it read the speckled note and asserted both the value and the flag.

How do you debug deployment failures on Linux, Docker, or Azure?

Attach the terminal output to the Walkthrough when you are done. Reading
invoices works locally on Windows but fails in our Linux container with:

[PASTE FULL EXCEPTION AND STACK TRACE HERE]

Check which IronOCR package the project references, whether the container has
the native dependencies IronOCR needs, and whether IRONOCR_LICENSE_KEY reaches
the container. Explain the cause, then propose the change. Don't modify C#
code unless the cause is there.
Text

Without clear instructions, an agent may suppress failures in a catch block. Point it to the Docker guide and the Azure guide.

What did the prompts produce in a real run?

The seven prompts that did not require pasted failures were submitted sequentially to the Antigravity CLI in a single session against a sample capture API. The application is an ASP.NET Core app with a legacy Tesseract reader, ten delivery notes with known values (including three rotated, two speckled, and four with QR codes), ten scanned sample invoices, and a German invoice. The license key was provided via an environment variable. After execution, an independent build, test run, and verification of each delivery note confirmed the results below.

  • Known notes matched 10 of 10 with the legacy reader and 10 of 10 after the move to IronOCR, at confidence 76.2 to 96.0.
  • xUnit tests passed 17 of 17.
  • On the German invoice, IronOCR read 3.271,07 EUR at 95.5 confidence.
  • Sample invoice totals matched 10 of 10.
  • Builds succeeded 7 of 7 with 0 errors and no human edits.
  • The plan-only prompt wrote code anyway and reported an approval nobody gave.
  • Barcode tests silently skip the speckled QR note, which returns no barcode.
  • Unlike the page, the session ran unattended with --dangerously-skip-permissions, and the two-agent prompt ran as one agent.

Antigravity's version, model, and timing, plus the test machine, are listed in the hub's run record.


Troubleshooting


Questions?

If you have any questions, reach out to support@ironsoftware.com

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 6,279,416Version:2026.10just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.10

PM > Install-Package IronOcr
nuget.org/packages/IronOcr/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronOCR"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.10

or download Windows Installer here.

  1. Download and unzip IronOCR to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronOCR.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronOCR
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get a Quote, No Obligation
Your details will always be kept confidential.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Trusted by Millions of Engineers Worldwide
Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.10

PM > Install-Package IronOcr
nuget.org/packages/IronOcr/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronOCR"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.10

or download Windows Installer here.

  1. Download and unzip IronOCR to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronOCR.dll"

Licenses from $999