# How to Use IronOCR with Cursor
Most IronOCR code an AI agent writes looks correct and often runs. Some of it does not. Code that reads barcodes without enabling barcode collection returns no barcodes. Code that sets German as the language without installing the German language pack throws a LanguagePackException. The model writes from its training data, which is why it is fast and also why it gets details like this wrong.
Cursor is an AI code editor built on the VS Code codebase. It can read documentation you link and apply rule files committed to your repository, so its suggestions follow IronOCR's API and your team's conventions. IronOCR is a C# library that reads text, barcodes and table structures locally.
Each cleanup filter is both a method on the input and a value in a filter enum, and the name alone does not say which one the code needs. That matters most for precise changes, such as choosing the filter for [poor scans](https://ironsoftware.com/ocr/csharp/how-to/image-quality-correction/), [reading PDFs without text layers](https://ironsoftware.com/ocr/csharp/how-to/input-pdfs/) or [preserving table structures](https://ironsoftware.com/ocr/csharp/how-to/read-table-in-document/).
Reading handwriting and photographs with IronOCR is addressed separately in the [handwriting guide](https://ironsoftware.com/ocr/csharp/how-to/read-handwritten-image/) and the [photo reading guide](https://ironsoftware.com/ocr/csharp/how-to/read-photo/).
*as-heading:2(Quickstart)*
!!!--LIBRARY_NUGET_INSTALL_BLOCK--!!!
Within a C# project, send this request.
```text
@Program.cs Read https://ironsoftware.com/ocr/csharp/llms-full.txt first.
In this C# project, read TestData/skewed-scan.png twice, once untouched and once
with a single correction filter applied to the input, and print both confidence
scores exactly as IronOCR returns them so I can compare them. Read the license
key from the IRONOCR_LICENSE_KEY environment variable and never print it. Use
only members that appear in the documentation.
```
The [license key guide](https://ironsoftware.com/ocr/csharp/get-started/license-keys/) shows each way to apply the key.
<div class="hsg-featured-snippet">
<h3>Minimal Workflow (5 steps)</h3>
<ol>
<li><a class="js-modal-open" data-modal-id="trial-license-after-download" href="https://www.nuget.org/packages/IronOcr/">Download the C# OCR library from NuGet</a></li>
<li>Commit a folder-scoped rule that holds the IronOCR documentation link</li>
<li>Name the IronOCR package in the same rule and keep its version in <code>Directory.Packages.props</code></li>
<li>Point every request at the relevant code and sample scans</li>
<li>Compile and compare the extracted values with known pages</li>
</ol>
</div>
<br class="clear" />
---
## Which Cursor model should you use for OCR work?
Composer is Cursor's own agentic model. The model picker also offers SpaceXAI's Grok models, which Cursor co-developed, and models from OpenAI, Anthropic, Google and other labs. The test run below used Grok 4.7.
OCR work is mostly short cycles of adding a filter, rebuilding and rereading samples, and a fast model handles those well. When a batch of production scans returns wrong fields for no clear reason, switch to a slower model that reasons longer.
## How do you give Cursor the IronOCR documentation?
The [full text file for LLMs](https://ironsoftware.com/ocr/csharp/llms-full.txt) summarizes 145 documentation pages at one URL. As of October 2026, Cursor's `@` menu attaches files, folders, terminals, chats, Git diffs and the browser, so IronOCR's documentation reaches the agent as a link.
```text
Read https://ironsoftware.com/ocr/csharp/llms-full.txt
How do I read a scanned PDF and save a searchable copy, and how do I straighten
a slightly rotated page before reading it? Show the exact class and member names
from the documentation, and link the page you took them from.
```
## How do you write project rules that encode your IronOCR conventions?
Project rules are stored in the `.cursor/rules` folder at the repository root. Because they are committed with the code, every clone of the repository receives an identical set.
Rules are `.mdc` files, written in Markdown with YAML frontmatter. Subfolders are read as well. Cursor ignores a plain Markdown file in this folder, because the file has no frontmatter to say when to apply it. Here is what an IronOCR rule might contain.
```markdown
---
description: IronOCR conventions for scan reading in this project
globs: Imports/**/*.cs, Capture/**/*.cs
alwaysApply: false
---
# IronOCR conventions
- Use IronOCR for all OCR work. The NuGet package is IronOcr on Windows and
IronOcr.Linux on Linux and Docker. The namespace is IronOcr. Do not add
another OCR engine or a cloud OCR service.
- Documentation: https://ironsoftware.com/ocr/csharp/llms-full.txt
- Skill file with recipes: https://ironsoftware.com/ocr/csharp/skill.md
- Target the IronOcr version pinned in Directory.Packages.props. Do not upgrade
it as part of an unrelated change.
- Never inline a license key. Read it from configuration or the
IRONOCR_LICENSE_KEY environment variable.
- Dispose OcrInput with a using block.
- Any language other than English needs its IronOcr.Languages package first.
Language packs keep their own version numbers, so pin the newest one on NuGet.
- Do not invent IronOCR API names. If a member is uncertain, say so and cite
the documentation instead of guessing.
```
Select the globs carefully. A rule that always applies attaches to every chat session and uses extra context, so scope the IronOCR rule to the folders that hold OCR code.
[[i:(Cursor also reads a root `AGENTS.md`. It has no frontmatter and therefore no globs, so a root file applies to the whole repository. To scope its instructions, add another one in the subdirectory it should cover.)]]
Rules apply to Agent requests. According to Cursor's documentation, they do not affect Tab autocomplete, and user rules do not apply to inline edits. Check suggestions from those features against the rule yourself.
## How do you map Tesseract settings to IronOCR?
A model that knows Tesseract command lines better than IronOCR code may write a Tesseract flag or variable name where an IronOCR setting belongs.
| Tesseract | IronOCR |
|---|---|
| `--psm 7` | `Configuration.PageSegmentationMode = TesseractPageSegmentationMode.SingleLine` |
| `--oem 1` | Nothing to set. LSTM is the only engine |
| `-c tessedit_char_whitelist=...` | `Configuration.WhiteListCharacters` |
| Other `-c` variables | `Configuration.TesseractVariables` |
| `-l eng+deu` | `AddSecondaryLanguage(OcrLanguage.German)` |
| `--tessdata-dir`, `TESSDATA_PREFIX` | `UseCustomTesseractLanguageFile` for one `.traineddata` file, `Installation.LanguagePackDirectory` for a folder of `.ocrdata` files |
IronOCR's filter wizard needs the same care. It tests filter combinations and returns the best one as C# code, but that code builds the input from a file path through a constructor the compiler flags as obsolete. The wizard is also slow. One 200 DPI page took nearly nine minutes on our test machine, so run it on a single page.
Two more entries in the rule cover both cases.
```markdown
- Configure Tesseract through IronTesseract.Configuration properties, never raw
tessedit_* variables or command-line flags. Use TesseractVariables only for a
setting with no named property.
- Rewrite OcrInputFilterWizard output from new OcrInput(path) to new OcrInput()
with LoadImage or LoadPdf before it reaches the codebase.
```
## Which mode fits the change?
Cursor provides five ways to make a change. Match the feature to the size of the work.
| Feature | Use it when | OCR example |
|---|---|---|
| Tab | The next edit is predictable | Repeating a filter option |
| Inline edit | One file, one sentence | A filter on one reader |
| Agent | Several files and a build loop | A reader and the job that prints it |
| Plan Mode | Too big to review afterward | Migrating off Tesseract |
| Cloud Agent | Unattended work | Known-page tests |
For an inline edit, select the relevant lines, press Ctrl+K (Cmd+K on macOS), and describe the change. Barcodes on a delivery note are an Agent change.
```text
@Imports/DeliveryNotes.cs @Imports/ImportJob.cs Read https://ironsoftware.com/ocr/csharp/skill.md first.
Also return every barcode and QR code on each delivery note, and have the notes
command print each one's format and value.
```
Barcodes are collected only when `Configuration.ReadBarCodes` is set before the read. They come back on the same result as the text, so one read covers both. The skill file shows that setting.
## What does an @ mention add to a request?
Referencing the actual reader file is preferable to using summaries, as summaries may omit important details.
```text
@Imports/InvoiceReader.cs @TestData/warehouse/
InvoiceReader reads every scan in TestData/warehouse/ without an error, but about
a third of the totals have one wrong digit. Fix the input preparation, not the
parsing. Explain which setting caused it, and report how many totals match
expected.csv before and after.
```
If you are unsure which files are relevant, omit the mention and Agent will search the codebase itself.
Include sample scans in your context too. Running the real files through the filters shows which combination fixes them. On our warehouse set, `Deskew` alone read 5 of 9 totals and `DeNoise` alone 2. The fix needed both, in that order. The [image orientation correction guide](https://ironsoftware.com/ocr/csharp/how-to/image-orientation-correction/) and the [image quality correction guide](https://ironsoftware.com/ocr/csharp/how-to/image-quality-correction/) cover the relevant filters.
## How do you plan and run a migration to IronOCR?
Switch to Plan Mode and send this request.
```text
@Imports/ScanOcrService.cs
ScanOcrService reads scans with the Tesseract NuGet package. Plan a migration of
it to IronOCR.
List every read it performs, with the settings it uses (language, page
segmentation, preprocessing, region, output format), map each one to its IronOCR
equivalent, and name the files that change. Keep existing public method
signatures so callers don't change. If anything is ambiguous, choose and state
your assumption, and do not ask. Don't write code yet.
```
Then click Build or send the request below in Agent.
```text
@Imports/ Implement the approved plan. Then run dotnet build, fix what breaks, confirm
every page in TestData/known/ still returns its expected values, and show me the
diff. Don't add new packages beyond IronOcr and any language packs the plan names.
```
A Cloud Agent, formerly called a Background Agent, requires a paid plan, runs in a cloud VM, and needs a connected repository to work on your code. Add `IRONOCR_LICENSE_KEY` as a secret in the Cloud Agents dashboard before starting. Begin the tests after the migration is merged.
```text
@Imports/ @TestData/ Write xUnit tests for the migrated OCR service in a
tests/Imports.Tests project that Imports.csproj does not compile. Every page in
TestData/known/ returns its expected invoice number and total, a page without a
total returns null, DeliveryNotes returns the codes in TestData/notes/expected.csv,
and a read with OcrLanguage.French, whose language pack is not installed,
produces a clear error. The tests read the license key from IRONOCR_LICENSE_KEY
and never print it. Assert on extracted fields, never on full page text. Run
dotnet test and fix what fails.
```
The [AI coding assistants guide](https://ironsoftware.com/ocr/csharp/ai-agents/ai/) runs a complete task with defined pass criteria.
## How do you debug wrong or missing OCR values?
```text
@Imports/InvoiceReader.cs @Imports/DeliveryNotes.cs @TestData/returns/
Returned-goods invoices come back with a wrong digit in the total, and delivery
notes return no barcodes even though every note has one. Explain the cause of
each before changing anything, then fix both.
```
If a container's exception is in a Cursor terminal, add `@Terminals` to the request below as well.
```text
@Dockerfile @Imports.csproj Read https://ironsoftware.com/ocr/csharp/skill.md first.
Reads work on Windows but fail when this app runs in our Linux container. Check
which IronOCR package the project references, whether the container image has
the native dependencies IronOCR needs, and whether the license key reaches the
container. Explain the cause, then propose the change. Don't modify C# code
unless the cause is there.
```
## What did the prompts produce in a real run?
The nine prompts went to Cursor in order, against a sample imports app. It is a console project with central package management, IronOCR invoice and delivery note readers, a scan service on the Tesseract wrapper, and scans with known values. The license key was set only in the editor's environment. After the run, fresh Release builds of each commit read every test folder again and reproduced the figures below.
- Warehouse invoice totals went from 6 of 9 before the fix to 9 of 9 after.
- No delivery note barcodes came back before the fix. After it, all 8 of 8 notes had their codes and no extra ones.
- On the returned-goods branch, invoice totals rose from 4 of 6 to 6 of 6 and note barcodes from none to 6 of 6.
- The skewed scan read at 87.79 confidence untouched and 96.41 after `Deskew`.
- After the migration the known pages still read 10 of 10 and the German totals 3 of 3, as before.
- The xUnit suite passed 20 of 20 tests.
- Every Release build had 0 errors and needed no hand edits. The migration set the obsolete `EngineMode`, which left two CS0618 warnings.
- The container answer named `IronOcr.Linux`, the Docker guide's apt packages and the missing key, and changed no C# file.
- Some steps ran differently from this page. Prompts were sent by hand in the desktop app, the plan was approved by sending the next prompt with Build never clicked, and the Cloud Agent prompt ran locally. Prompt eight first went to the earlier chat by mistake and was reset and resent. With no Docker on the machine, the container prompt was judged on its explanation and proposal.
The [run record](/ocr/csharp/ai-agents/ai/#the-run-record) lists the versions, timing and test machine for this guide alongside the others.
---
## Troubleshooting
- [Apply a License Key in IronOCR](https://ironsoftware.com/ocr/csharp/troubleshooting/apply-a-license-key-in-ironocr/) if generated code throws a licensing exception
- [Read Barcodes with IronOCR](https://ironsoftware.com/ocr/csharp/how-to/barcodes/) if a read returns text but no barcodes
- [Improve OCR Accuracy](https://ironsoftware.com/ocr/csharp/troubleshooting/improve-ocr-accuracy/) if the values read do not match the scan
- [IronOCR on Docker](https://ironsoftware.com/ocr/csharp/get-started/docker/) if reads work locally and fail inside a Linux container
---
## Questions?
If you have any questions, reach out to [support@ironsoftware.com](mailto:support@ironsoftware.com)
Most IronOCR code an AI agent writes looks correct and often runs. Some of it does not. Code that reads barcodes without enabling barcode collection returns no barcodes. Code that sets German as the language without installing the German language pack throws a LanguagePackException. The model writes from its training data, which is why it is fast and also why it gets details like this wrong.
Cursor is an AI code editor built on the VS Code codebase. It can read documentation you link and apply rule files committed to your repository, so its suggestions follow IronOCR's API and your team's conventions. IronOCR is a C# library that reads text, barcodes and table structures locally.
Each cleanup filter is both a method on the input and a value in a filter enum, and the name alone does not say which one the code needs. That matters most for precise changes, such as choosing the filter for poor scans, reading PDFs without text layers or preserving table structures.
Install IronOCR by running the command above in the NuGet Package Manager Console, or search for the package in the NuGet Package Manager.
Within a C# project, send this request.
@Program.cs Read https://ironsoftware.com/ocr/csharp/llms-full.txt first.In this C# project, read TestData/skewed-scan.png twice, once untouched and oncewith a single correction filter applied to the input, and print both confidencescores exactly as IronOCR returns them so I can compare them. Read the licensekey from the IRONOCR_LICENSE_KEY environment variable and never print it. Useonly members that appear in the documentation.
@Program.cs Read https://ironsoftware.com/ocr/csharp/llms-full.txt first.
In this C# project, read TestData/skewed-scan.png twice, once untouched and once
with a single correction filter applied to the input, and print both confidence
scores exactly as IronOCR returns them so I can compare them. Read the license
key from the IRONOCR_LICENSE_KEY environment variable and never print it. Use
only members that appear in the documentation.
Commit a folder-scoped rule that holds the IronOCR documentation link
Name the IronOCR package in the same rule and keep its version in Directory.Packages.props
Point every request at the relevant code and sample scans
Compile and compare the extracted values with known pages
Which Cursor model should you use for OCR work?
Composer is Cursor's own agentic model. The model picker also offers SpaceXAI's Grok models, which Cursor co-developed, and models from OpenAI, Anthropic, Google and other labs. The test run below used Grok 4.7.
OCR work is mostly short cycles of adding a filter, rebuilding and rereading samples, and a fast model handles those well. When a batch of production scans returns wrong fields for no clear reason, switch to a slower model that reasons longer.
How do you give Cursor the IronOCR documentation?
The full text file for LLMs summarizes 145 documentation pages at one URL. As of October 2026, Cursor's @ menu attaches files, folders, terminals, chats, Git diffs and the browser, so IronOCR's documentation reaches the agent as a link.
Read https://ironsoftware.com/ocr/csharp/llms-full.txtHow do I read a scanned PDF and save a searchable copy, and how do I straightena slightly rotated page before reading it? Show the exact class and member namesfrom the documentation, and link the page you took them from.
Read https://ironsoftware.com/ocr/csharp/llms-full.txt
How do I read a scanned PDF and save a searchable copy, and how do I straighten
a slightly rotated page before reading it? Show the exact class and member names
from the documentation, and link the page you took them from.
Text
How do you write project rules that encode your IronOCR conventions?
Project rules are stored in the .cursor/rules folder at the repository root. Because they are committed with the code, every clone of the repository receives an identical set.
Rules are .mdc files, written in Markdown with YAML frontmatter. Subfolders are read as well. Cursor ignores a plain Markdown file in this folder, because the file has no frontmatter to say when to apply it. Here is what an IronOCR rule might contain.
---description: IronOCR conventions for scan reading in this projectglobs: Imports/**/*.cs, Capture/**/*.csalwaysApply: false---# IronOCR conventions- Use IronOCR for all OCR work. The NuGet package is IronOcr on Windows and IronOcr.Linux on Linux and Docker. The namespace is IronOcr. Do not add another OCR engine or a cloud OCR service.- Documentation: https://ironsoftware.com/ocr/csharp/llms-full.txt- Skill file with recipes: https://ironsoftware.com/ocr/csharp/skill.md- Target the IronOcr version pinned in Directory.Packages.props. Do not upgrade it as part of an unrelated change.- Never inline a license key. Read it from configuration or the IRONOCR_LICENSE_KEY environment variable.- Dispose OcrInput with a using block.- Any language other than English needs its IronOcr.Languages package first. Language packs keep their own version numbers, so pin the newest one on NuGet.- Do not invent IronOCR API names. If a member is uncertain, say so and cite the documentation instead of guessing.
---
description: IronOCR conventions for scan reading in this project
globs: Imports/**/*.cs, Capture/**/*.cs
alwaysApply: false
---
# IronOCR conventions
- Use IronOCR for all OCR work. The NuGet package is IronOcr on Windows and
IronOcr.Linux on Linux and Docker. The namespace is IronOcr. Do not add
another OCR engine or a cloud OCR service.
- Documentation: https://ironsoftware.com/ocr/csharp/llms-full.txt
- Skill file with recipes: https://ironsoftware.com/ocr/csharp/skill.md
- Target the IronOcr version pinned in Directory.Packages.props. Do not upgrade
it as part of an unrelated change.
- Never inline a license key. Read it from configuration or the
IRONOCR_LICENSE_KEY environment variable.
- Dispose OcrInput with a using block.
- Any language other than English needs its IronOcr.Languages package first.
Language packs keep their own version numbers, so pin the newest one on NuGet.
- Do not invent IronOCR API names. If a member is uncertain, say so and cite
the documentation instead of guessing.
Text
Select the globs carefully. A rule that always applies attaches to every chat session and uses extra context, so scope the IronOCR rule to the folders that hold OCR code.
Please note: Cursor also reads a root AGENTS.md. It has no frontmatter and therefore no globs, so a root file applies to the whole repository. To scope its instructions, add another one in the subdirectory it should cover.
Rules apply to Agent requests. According to Cursor's documentation, they do not affect Tab autocomplete, and user rules do not apply to inline edits. Check suggestions from those features against the rule yourself.
How do you map Tesseract settings to IronOCR?
A model that knows Tesseract command lines better than IronOCR code may write a Tesseract flag or variable name where an IronOCR setting belongs.
UseCustomTesseractLanguageFile for one .traineddata file, Installation.LanguagePackDirectory for a folder of .ocrdata files
IronOCR's filter wizard needs the same care. It tests filter combinations and returns the best one as C# code, but that code builds the input from a file path through a constructor the compiler flags as obsolete. The wizard is also slow. One 200 DPI page took nearly nine minutes on our test machine, so run it on a single page.
Two more entries in the rule cover both cases.
- Configure Tesseract through IronTesseract.Configuration properties, never raw tessedit_* variables or command-line flags. Use TesseractVariables only for a setting with no named property.- Rewrite OcrInputFilterWizard output from new OcrInput(path) to new OcrInput() with LoadImage or LoadPdf before it reaches the codebase.
- Configure Tesseract through IronTesseract.Configuration properties, never raw
tessedit_* variables or command-line flags. Use TesseractVariables only for a
setting with no named property.
- Rewrite OcrInputFilterWizard output from new OcrInput(path) to new OcrInput()
with LoadImage or LoadPdf before it reaches the codebase.
Text
Which mode fits the change?
Cursor provides five ways to make a change. Match the feature to the size of the work.
Feature
Use it when
OCR example
Tab
The next edit is predictable
Repeating a filter option
Inline edit
One file, one sentence
A filter on one reader
Agent
Several files and a build loop
A reader and the job that prints it
Plan Mode
Too big to review afterward
Migrating off Tesseract
Cloud Agent
Unattended work
Known-page tests
For an inline edit, select the relevant lines, press Ctrl+K (Cmd+K on macOS), and describe the change. Barcodes on a delivery note are an Agent change.
@Imports/DeliveryNotes.cs @Imports/ImportJob.cs Read https://ironsoftware.com/ocr/csharp/skill.md first.Also return every barcode and QR code on each delivery note, and have the notescommand print each one's format and value.
@Imports/DeliveryNotes.cs @Imports/ImportJob.cs Read https://ironsoftware.com/ocr/csharp/skill.md first.
Also return every barcode and QR code on each delivery note, and have the notes
command print each one's format and value.
Text
Barcodes are collected only when Configuration.ReadBarCodes is set before the read. They come back on the same result as the text, so one read covers both. The skill file shows that setting.
What does an @ mention add to a request?
Referencing the actual reader file is preferable to using summaries, as summaries may omit important details.
@Imports/InvoiceReader.cs @TestData/warehouse/InvoiceReader reads every scan in TestData/warehouse/ without an error, but abouta third of the totals have one wrong digit. Fix the input preparation, not theparsing. Explain which setting caused it, and report how many totals matchexpected.csv before and after.
@Imports/InvoiceReader.cs @TestData/warehouse/
InvoiceReader reads every scan in TestData/warehouse/ without an error, but about
a third of the totals have one wrong digit. Fix the input preparation, not the
parsing. Explain which setting caused it, and report how many totals match
expected.csv before and after.
Text
If you are unsure which files are relevant, omit the mention and Agent will search the codebase itself.
Include sample scans in your context too. Running the real files through the filters shows which combination fixes them. On our warehouse set, Deskew alone read 5 of 9 totals and DeNoise alone 2. The fix needed both, in that order. The image orientation correction guide and the image quality correction guide cover the relevant filters.
How do you plan and run a migration to IronOCR?
Switch to Plan Mode and send this request.
@Imports/ScanOcrService.csScanOcrService reads scans with the Tesseract NuGet package. Plan a migration ofit to IronOCR.List every read it performs, with the settings it uses (language, pagesegmentation, preprocessing, region, output format), map each one to its IronOCRequivalent, and name the files that change. Keep existing public methodsignatures so callers don't change. If anything is ambiguous, choose and stateyour assumption, and do not ask. Don't write code yet.
@Imports/ScanOcrService.cs
ScanOcrService reads scans with the Tesseract NuGet package. Plan a migration of
it to IronOCR.
List every read it performs, with the settings it uses (language, page
segmentation, preprocessing, region, output format), map each one to its IronOCR
equivalent, and name the files that change. Keep existing public method
signatures so callers don't change. If anything is ambiguous, choose and state
your assumption, and do not ask. Don't write code yet.
Text
Then click Build or send the request below in Agent.
@Imports/ Implement the approved plan. Then run dotnet build, fix what breaks, confirmevery page in TestData/known/ still returns its expected values, and show me thediff. Don't add new packages beyond IronOcr and any language packs the plan names.
@Imports/ Implement the approved plan. Then run dotnet build, fix what breaks, confirm
every page in TestData/known/ still returns its expected values, and show me the
diff. Don't add new packages beyond IronOcr and any language packs the plan names.
Text
A Cloud Agent, formerly called a Background Agent, requires a paid plan, runs in a cloud VM, and needs a connected repository to work on your code. Add IRONOCR_LICENSE_KEY as a secret in the Cloud Agents dashboard before starting. Begin the tests after the migration is merged.
@Imports/ @TestData/ Write xUnit tests for the migrated OCR service in atests/Imports.Tests project that Imports.csproj does not compile. Every page inTestData/known/ returns its expected invoice number and total, a page without atotal returns null, DeliveryNotes returns the codes in TestData/notes/expected.csv,and a read with OcrLanguage.French, whose language pack is not installed,produces a clear error. The tests read the license key from IRONOCR_LICENSE_KEYand never print it. Assert on extracted fields, never on full page text. Rundotnet test and fix what fails.
@Imports/ @TestData/ Write xUnit tests for the migrated OCR service in a
tests/Imports.Tests project that Imports.csproj does not compile. Every page in
TestData/known/ returns its expected invoice number and total, a page without a
total returns null, DeliveryNotes returns the codes in TestData/notes/expected.csv,
and a read with OcrLanguage.French, whose language pack is not installed,
produces a clear error. The tests read the license key from IRONOCR_LICENSE_KEY
and never print it. Assert on extracted fields, never on full page text. Run
dotnet test and fix what fails.
@Imports/InvoiceReader.cs @Imports/DeliveryNotes.cs @TestData/returns/Returned-goods invoices come back with a wrong digit in the total, and deliverynotes return no barcodes even though every note has one. Explain the cause ofeach before changing anything, then fix both.
@Imports/InvoiceReader.cs @Imports/DeliveryNotes.cs @TestData/returns/
Returned-goods invoices come back with a wrong digit in the total, and delivery
notes return no barcodes even though every note has one. Explain the cause of
each before changing anything, then fix both.
Text
If a container's exception is in a Cursor terminal, add @Terminals to the request below as well.
@Dockerfile @Imports.csproj Read https://ironsoftware.com/ocr/csharp/skill.md first.Reads work on Windows but fail when this app runs in our Linux container. Checkwhich IronOCR package the project references, whether the container image hasthe native dependencies IronOCR needs, and whether the license key reaches thecontainer. Explain the cause, then propose the change. Don't modify C# codeunless the cause is there.
@Dockerfile @Imports.csproj Read https://ironsoftware.com/ocr/csharp/skill.md first.
Reads work on Windows but fail when this app runs in our Linux container. Check
which IronOCR package the project references, whether the container image has
the native dependencies IronOCR needs, and whether the license key reaches the
container. Explain the cause, then propose the change. Don't modify C# code
unless the cause is there.
Text
What did the prompts produce in a real run?
The nine prompts went to Cursor in order, against a sample imports app. It is a console project with central package management, IronOCR invoice and delivery note readers, a scan service on the Tesseract wrapper, and scans with known values. The license key was set only in the editor's environment. After the run, fresh Release builds of each commit read every test folder again and reproduced the figures below.
Warehouse invoice totals went from 6 of 9 before the fix to 9 of 9 after.
No delivery note barcodes came back before the fix. After it, all 8 of 8 notes had their codes and no extra ones.
On the returned-goods branch, invoice totals rose from 4 of 6 to 6 of 6 and note barcodes from none to 6 of 6.
The skewed scan read at 87.79 confidence untouched and 96.41 after Deskew.
After the migration the known pages still read 10 of 10 and the German totals 3 of 3, as before.
The xUnit suite passed 20 of 20 tests.
Every Release build had 0 errors and needed no hand edits. The migration set the obsolete EngineMode, which left two CS0618 warnings.
The container answer named IronOcr.Linux, the Docker guide's apt packages and the missing key, and changed no C# file.
Some steps ran differently from this page. Prompts were sent by hand in the desktop app, the plan was approved by sending the next prompt with Build never clicked, and the Cloud Agent prompt ran locally. Prompt eight first went to the earlier chat by mistake and was reset and resent. With no Docker on the machine, the container prompt was judged on its explanation and proposal.
The run record lists the versions, timing and test machine for this guide alongside the others.
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.