<meta http-equiv="content-language" content="la" />
<h1>.NET et Latine PDF in C#</h1>
<h6>Other versions of this document:</h6>
<ul>
<li><a rel='alternate' hreflang='en' href="/csharp/ocr/languages/latin/">anglicus (This Page in English)</a></li>
<li><a href="/csharp/ocr/languages/">magis Linguæ</a></li>
</ul>
<p>IronOCR .NET quod C# software pars permittens coders legere text et imagines ab PDF documents in lingua CXXVI, inter latinam.</p>
<p>Bivio Tesseract provectus est constructum in nisi tincidunt NET outperforms regulariter et alia tormenta properat Tesseract sagaciter.</p>
<h2>Contentis in IronOcr.Languages.Latin</h2>
<p>XL Haec contain sarcina pro .NET PDF linguis:</p>
<ul>
<li>Latine</li>
<li>LatinBest</li>
<li>LatinFast</li>
</ul>
<h2>Download</h2>
<p>Pack Lingua Latina [microform] <br />
* Download as <a class='languages-dll' href='/csharp/ocr/packages/language-packs/Latin.ocrdata.zip'>zip <i class='fas fa-download'></i></a><br />
* Install with NuGet as <a target='_blank' class='languages-nuget' href="https://www.nuget.org/packages/IronOcr.Languages.Latin/">https://www.nuget.org/packages/IronOcr.Languages.Latin/</a></p>
<h2>Institutionem</h2>
<p>Primum quod nobis have efficio est install sarcina ad nos <strong>latine</strong> PDF .NET project.</p>
<pre><code class="shell">PM> Install-Package IronOcr.Languages.Latin</code></pre>
<h2>Exemplum Code</h2>
<p># Latine legit illud a C codice exempli gratia haec est imago seu PDF document.</p>
```csharp
// PM> Install-Package IronOcr.Languages.Latin
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Latin
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput(@"images\Latin.png"))
{
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
}
```
<h2>Elige IronOCR Quid?</h2>
<p>PDF est facilis ad install ferrum: et integram bibliothecam bene amet .NET software.</p>
<p>Elige IronOCR ut consequi <strong>accurate 99.8% + reproduction</strong> aliqua externa absque usura textus muneris, permanens in interrete documenta secreto fees et mittens.</p>
<h4>Cur C#developers eligere IronOCR super Vanilla Tesseract:</h4>
<ul>
<li>DLL ut install vel una NuGet</li>
<li>Includit enim Tesseract V, III et IV Engines ex arca archa.</li>
<li>Sagaciter <strong>99.8%</strong> significantly outperforms Tesseract iusto.</li>
<li>Mobilitate et Blazing MultiThreading</li>
<li>MVC, WebApp, Desktop: Servo Console & Application compatible</li>
<li>Non est opus in codice C++ vel Exes</li>
<li>PDF PDF plena firmamentum</li>
<li>PDF PDF et praestare aut quasi quis lima Image</li>
<li>.NET plena Core Latin compage et firmamentum</li>
<li>Deploy in Fenestra, Mac, Linux, parma caelurea, Docker, Lambda, AWS</li>
<li>Read barcodes et QR codes</li>
<li>Export PDF ut prime</li>
<li>PDF PDF documents ut export searchable</li>
<li>Multithreading firmamentum</li>
<li>CXXVI managed omnibus linguis gentium, aut per NuGet OcrData files</li>
<li>Extract Images, Coordinata geographica, photos and Pelvis. Non iustus text.</li>
<li>PDF interius posse ad redistribuere Tesseract commercial & proprietary applications.</li>
</ul>
<p><em>Quando operantes cum reali mundi imagines, et ferrum lucet PDF documents ut imperfectus imagines, vel de visu perlustrat low resolutio cuius sonitus aut digital imperfectionibus.</em></p>
<p>Alius <a href="/csharp/ocr/use-case/free-ocr-csharp/">liber PDF</a> libraries pro .NET platform alia huiusmodi .NET Tesseract APIs telam, et non officia praestare, ita etiam in his casibus, uti realem mundi.</p>
<h2>PDF cum Tesseract V - start coding in C#</h2>
<p>In codice infra sample ostendit quomodo legere facile est in textu, ex imagine usura .NET C#aut VB.</p>
<h3>OneLiner</h3>
```csharp
// Read text from an image in one line
string Text = new IronTesseract().Read(@"img\Screenshot.png").Text;
```
<h3>Salve Configurable Orbis Terrarum</h3>
```csharp
// PM> Install-Package IronOcr.Languages.Latin
using IronOcr;
var Ocr = new IronTesseract();
// Set the language to Latin
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
// Add an image to the OCR input
Input.AddImage("images/sample.jpeg");
// You can add any number of images ...
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
}
```
<h3>Eliciting Text from a PDF in C#</h3>
<p>Et similiter potest uelim sese uti in textus ab aliquo PDF document eliciunt.</p>
```csharp
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var input = new OcrInput())
{
// Add a PDF document as input
input.AddPdf("example.pdf", "password");
// Read the text from the PDF document
var Result = Ocr.Read(input);
// Write the text to the console
Console.WriteLine(Result.Text);
Console.WriteLine($"{Result.Pages.Count} Pages");
}
```
<h3>Handling MultiPage PDF and TIFF</h3>
<p>Lectio TIFF comprehendo multiple lima page format PDF documents. TIFF quoque conversus recta cum solis archivii PDF searchable in textu.</p>
```csharp
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
// Process a multi-frame TIFF
Input.AddMultiFrameTiff("multi-frame.tiff");
var Result = Ocr.Read(Input);
// Output recognized text
Console.WriteLine(Result.Text);
}
```
<h3>Reading Barcodes and QR Codes</h3>
<p>A unique feature to read barcodes and QR codes from documents while scanning text. The <code>OcrResult.OcrBarcode</code> class provides developers access to barcode scanning results.</p>
```csharp
using IronOcr;
var Ocr = new IronTesseract();
// Enable barcode reading
Ocr.Configuration.ReadBarCodes = true;
using (var input = new OcrInput())
{
// Add an image with a barcode
input.AddImage("img/Barcode.png");
var Result = Ocr.Read(input);
// Iterate and print each barcode found
foreach (var Barcode in Result.Barcodes)
{
Console.WriteLine(Barcode.Value);
// Other properties such as location and type are also accessible
}
}
```
<h3>PDF in certain images</h3>
<p>Specifying page areas to improve efficiency and save processing time.</p>
<p>To use crop regions, ensure <code>System.Drawing</code> is imported to use <code>System.Drawing.Rectangle</code>.</p>
```csharp
using IronOcr;
using System.Drawing;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
// Define the area of interest in the image
var ContentArea = new Rectangle()
{
X = 215,
Y = 1250,
Height = 280,
Width = 1335 // Measurements in pixels
};
Input.Add("document.png", ContentArea);
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
```
<h3>PDF scans for low-quality images</h3>
<p>Use <code>OcrInput</code> methods to enhance the quality of scans that normal Tesseract would struggle with.</p>
```csharp
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput(@"img\Potter.LowQuality.tiff"))
{
// Acts on the image to improve quality
Input.DeNoise(); // Removes noise
Input.Deskew(); // Corrects rotation and alignment
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
```
<h3>Export scanned PDF results as searchable PDF</h3>
<p>PDF Image conversion into searchable, indexable PDF format.</p>
```csharp
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
Input.Title = "Quarterly Report";
Input.AddImage("image1.jpeg");
Input.AddImage("image2.png");
Input.AddImage("image3.gif");
var Result = Ocr.Read(Input);
// Save recognized content as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf");
}
```
<h3>Conversion of TIFF to a searchable PDF</h3>
<p>Convert a TIFF with an entire image set directly into a searchable PDF that can be indexed by search engines or intranet services.</p>
```csharp
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
// Add TIFF images
Input.AddMultiFrameTiff("example.tiff");
var Result = Ocr.Read(Input);
// Save the recognized content as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf");
}
```
<h3>Reproduction of HTML and export results</h3>
<p>PDF Image prime conversion to HTML for text preservation.</p>
```csharp
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
Input.Title = "Html Title";
Input.AddImage("image1.jpeg");
var Result = Ocr.Read(Input);
// Save as HOCR HTML file, useful for web pages preserving layout
Result.SaveAsHocrFile("results.html");
}
```
<h2>PDF Image Enhancement Results</h2>
<p>IronOCR offers unique filters for <code>OcrInput</code> objects to enhance PDF input performance.</p>
<h3>Example Image Code Enhancement</h3>
<p>Enhancing input quality allows for higher accuracy and faster OCR processing.</p>
```csharp
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput(@"LowQuality.jpeg"))
{
// Improve image readability
Input.DeNoise(); // Clean up noisy data
Input.Deskew(); // Align the image correctly
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
```
<h3>Summary of available input enhancement filters</h3>
<ul>
<li> <strong>OcrInput.Rotate(double degrees)</strong>: Rotates images clockwise by the specified degrees. Use negative values for anti-clockwise.</li>
<li> <strong>OcrInput.Binarize()</strong>: Converts the image to black and white, useful for high-contrast OCR cases.</li>
<li> <strong>OcrInput.ToGrayScale()</strong>: Converts image pixels into grayscale to improve OCR accuracy.</li>
<li> <strong>OcrInput.Contrast()</strong>: Increases contrast to improve text readability.</li>
<li> <strong>OcrInput.DeNoise()</strong>: Removes digital noise to clean up the image.</li>
<li> <strong>OcrInput.Invert()</strong>: Inverts all colors, turning black to white and vice versa.</li>
<li> <strong>OcrInput.Dilate()</strong>: Adds expansion to object boundaries, useful for dilating thin text.</li>
<li> <strong>OcrInput.Erode()</strong>: Reduces the boundary of objects, the opposite of dilate.</li>
<li> <strong>OcrInput.Deskew()</strong>: Corrects image tilt, crucial for OCR accuracy when skew exceeds 5 degrees.</li>
<li> <strong>OcrInput.DeepCleanBackgroundNoise()</strong>: Advanced noise removal for heavily distorted documents.</li>
<li> <strong>OcrInput.EnhanceResolution</strong>: Automatically upscales images with low DPI for better recognition.</li>
</ul>
<p>Additional advanced settings in the OCR process aim to leverage unique IronOCR capabilities for optimal text scanning results.</p>
<h2>CXXVI Supported Languages</h2>
<p>IronOCR supports <strong>126 languages</strong> through downloadable language packs, available for <a href="/csharp/ocr/languages/">download</a> or from <a href="https://www.nuget.org/packages?q=IronOcr.Languages">NuGet Package Manager</a>.</p>
<p>Language options include major languages like German, French, English, Chinese, and Japanese, with special packages for specific text, such as passport MRZ, MICR, and more.</p>
<h3>Example using another language</h3>
<p>Using PDF with other languages.</p>
```csharp
// using IronOcr;
// PM> Install IronOcr.Languages.Arabic
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Arabic;
using (var input = new OcrInput())
{
input.AddImage("img/arabic.gif");
// If necessary, add image filters for quality improvement
var Result = Ocr.Read(input);
// Save the result to a text file for Arabic
Result.SaveAsTextFile("arabic.txt");
}
```
<h3>Example using multiple languages</h3>
<p>IronOCR can handle multiple languages simultaneously for comprehensive OCR of multilingual documents.</p>
```csharp
// using IronOcr;
// PM> Install IronOcr.Languages.ChineseSimplified
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.ChineseSimplified;
Ocr.AddSecondaryLanguage(OcrLanguage.Latin);
// Add any number of languages as needed
using (var input = new OcrInput())
{
input.Add("multi-language.pdf");
var Result = Ocr.Read(input);
// Save the multilingual result to a text file
Result.SaveAsTextFile("results.txt");
}
```
<h2>Detailed PDF Sed ea Results</h2>
<p>Successful OCR operations return detailed results allowing further exploration and analysis beyond just recognized text.</p>
```csharp
using IronOcr;
using System.Drawing; // Add assembly reference
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;
Ocr.Configuration.ReadBarCodes = true; // Enable barcode reading
using (var Input = new OcrInput(@"images\sample.tiff"))
{
OcrResult Result = Ocr.Read(Input);
// Explore the API for detailed information
var Pages = Result.Pages;
var Words = Pages[0].Words;
var Barcodes = Result.Barcodes;
// Detailed inspection of pages, paragraphs, lines, words, and coordinates
}
```
<h2>Performance</h2>
<p>IronOCR is designed to work effectively out-of-the-box without the need for extensive input image modifications or performance tuning.</p>
<p>With improved speed: IronOCR.2020 is approximately 10 times faster than previous builds with significantly fewer errors.</p>
<h2>Learn More</h2>
<p>To gain a deeper understanding of OCR reproduction using C#, VB, F#, or other .NET languages, please refer to our <a href="/csharp/ocr/tutorials/how-to-read-text-from-an-image-in-csharp-net/">community tutorials</a>, which provide real-life examples and show you how to get the best out of this library.</p>
<p>A full <a href="/csharp/ocr/object-reference/api/">API reference for .NET developers</a> is also available.</p>
Primum quod nobis have efficio est install sarcina ad nos latine PDF .NET project.
PM> Install-Package IronOcr.Languages.Latin
Exemplum Code
# Latine legit illud a C codice exempli gratia haec est imago seu PDF document.
// PM> Install-Package IronOcr.Languages.Latinusing IronOcr;varOcr = new IronTesseract();// Set the OCR language to LatinOcr.Language = OcrLanguage.Latin;using (varInput = new OcrInput(@"images\Latin.png")){ varResult = Ocr.Read(Input); // Retrieve the recognized text varAllText = Result.Text;}
// PM> Install-Package IronOcr.Languages.Latin
using IronOcr;
var Ocr = new IronTesseract();
// Set the OCR language to Latin
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput(@"images\Latin.png"))
{
var Result = Ocr.Read(Input);
// Retrieve the recognized text
var AllText = Result.Text;
}
' PM> Install-Package IronOcr.Languages.LatinImportsIronOcrPrivateOcr = New IronTesseract()' Set the OCR language to LatinOcr.Language = OcrLanguage.LatinUsingInput = New OcrInput("images\Latin.png") DimResult = Ocr.Read(Input) ' Retrieve the recognized text DimAllText = Result.TextEndUsing
' PM> Install-Package IronOcr.Languages.Latin
Imports IronOcr
Private Ocr = New IronTesseract()
' Set the OCR language to Latin
Ocr.Language = OcrLanguage.Latin
Using Input = New OcrInput("images\Latin.png")
Dim Result = Ocr.Read(Input)
' Retrieve the recognized text
Dim AllText = Result.Text
End Using
Elige IronOCR Quid?
PDF est facilis ad install ferrum: et integram bibliothecam bene amet .NET software.
Elige IronOCR ut consequi accurate 99.8% + reproduction aliqua externa absque usura textus muneris, permanens in interrete documenta secreto fees et mittens.
Cur C#developers eligere IronOCR super Vanilla Tesseract:
DLL ut install vel una NuGet
Includit enim Tesseract V, III et IV Engines ex arca archa.
Deploy in Fenestra, Mac, Linux, parma caelurea, Docker, Lambda, AWS
Read barcodes et QR codes
Export PDF ut prime
PDF PDF documents ut export searchable
Multithreading firmamentum
CXXVI managed omnibus linguis gentium, aut per NuGet OcrData files
Extract Images, Coordinata geographica, photos and Pelvis. Non iustus text.
PDF interius posse ad redistribuere Tesseract commercial & proprietary applications.
Quando operantes cum reali mundi imagines, et ferrum lucet PDF documents ut imperfectus imagines, vel de visu perlustrat low resolutio cuius sonitus aut digital imperfectionibus.
Alius liber PDF libraries pro .NET platform alia huiusmodi .NET Tesseract APIs telam, et non officia praestare, ita etiam in his casibus, uti realem mundi.
PDF cum Tesseract V - start coding in C#
In codice infra sample ostendit quomodo legere facile est in textu, ex imagine usura .NET C#aut VB.
OneLiner
// Read text from an image in one linestringText = new IronTesseract().Read(@"img\Screenshot.png").Text;
// Read text from an image in one line
string Text = new IronTesseract().Read(@"img\Screenshot.png").Text;
' Read text from an image in one lineDimTextAsString = (New IronTesseract()).Read("img\Screenshot.png").Text
' Read text from an image in one line
Dim Text As String = (New IronTesseract()).Read("img\Screenshot.png").Text
Salve Configurable Orbis Terrarum
// PM> Install-Package IronOcr.Languages.Latinusing IronOcr;varOcr = new IronTesseract();// Set the language to LatinOcr.Language = OcrLanguage.Latin;using (varInput = new OcrInput()){ // Add an image to the OCR inputInput.AddImage("images/sample.jpeg"); // You can add any number of images ... varResult = Ocr.Read(Input); // Output the recognized text to the consoleConsole.WriteLine(Result.Text);}
// PM> Install-Package IronOcr.Languages.Latin
using IronOcr;
var Ocr = new IronTesseract();
// Set the language to Latin
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
// Add an image to the OCR input
Input.AddImage("images/sample.jpeg");
// You can add any number of images ...
var Result = Ocr.Read(Input);
// Output the recognized text to the console
Console.WriteLine(Result.Text);
}
ImportsIronOcrDimOcr = New IronTesseract()' Set the language to LatinOcr.Language = OcrLanguage.LatinUsingInput = New OcrInput() ' Add an image to the OCR inputInput.AddImage("images/sample.jpeg") ' You can add any number of images ... DimResult = Ocr.Read(Input) ' Output the recognized text to the consoleConsole.WriteLine(Result.Text)EndUsing
Imports IronOcr
Dim Ocr = New IronTesseract()
' Set the language to Latin
Ocr.Language = OcrLanguage.Latin
Using Input = New OcrInput()
' Add an image to the OCR input
Input.AddImage("images/sample.jpeg")
' You can add any number of images ...
Dim Result = Ocr.Read(Input)
' Output the recognized text to the console
Console.WriteLine(Result.Text)
End Using
Eliciting Text from a PDF in C#
Et similiter potest uelim sese uti in textus ab aliquo PDF document eliciunt.
using IronOcr;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.Latin;using (var input = new OcrInput()){ // Add a PDF document as input input.AddPdf("example.pdf", "password"); // Read the text from the PDF document varResult = Ocr.Read(input); // Write the text to the consoleConsole.WriteLine(Result.Text);Console.WriteLine($"{Result.Pages.Count} Pages");}
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var input = new OcrInput())
{
// Add a PDF document as input
input.AddPdf("example.pdf", "password");
// Read the text from the PDF document
var Result = Ocr.Read(input);
// Write the text to the console
Console.WriteLine(Result.Text);
Console.WriteLine($"{Result.Pages.Count} Pages");
}
ImportsIronOcrPrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.LatinUsing input = New OcrInput() ' Add a PDF document as input input.AddPdf("example.pdf", "password") ' Read the text from the PDF document DimResult = Ocr.Read(input) ' Write the text to the consoleConsole.WriteLine(Result.Text)Console.WriteLine($"{Result.Pages.Count} Pages")EndUsing
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Latin
Using input = New OcrInput()
' Add a PDF document as input
input.AddPdf("example.pdf", "password")
' Read the text from the PDF document
Dim Result = Ocr.Read(input)
' Write the text to the console
Console.WriteLine(Result.Text)
Console.WriteLine($"{Result.Pages.Count} Pages")
End Using
Handling MultiPage PDF and TIFF
Lectio TIFF comprehendo multiple lima page format PDF documents. TIFF quoque conversus recta cum solis archivii PDF searchable in textu.
using IronOcr;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.Latin;using (varInput = new OcrInput()){ // Process a multi-frame TIFFInput.AddMultiFrameTiff("multi-frame.tiff"); varResult = Ocr.Read(Input); // Output recognized textConsole.WriteLine(Result.Text);}
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
// Process a multi-frame TIFF
Input.AddMultiFrameTiff("multi-frame.tiff");
var Result = Ocr.Read(Input);
// Output recognized text
Console.WriteLine(Result.Text);
}
ImportsIronOcrPrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.LatinUsingInput = New OcrInput() ' Process a multi-frame TIFFInput.AddMultiFrameTiff("multi-frame.tiff") DimResult = Ocr.Read(Input) ' Output recognized textConsole.WriteLine(Result.Text)EndUsing
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Latin
Using Input = New OcrInput()
' Process a multi-frame TIFF
Input.AddMultiFrameTiff("multi-frame.tiff")
Dim Result = Ocr.Read(Input)
' Output recognized text
Console.WriteLine(Result.Text)
End Using
Reading Barcodes and QR Codes
A unique feature to read barcodes and QR codes from documents while scanning text. The OcrResult.OcrBarcode class provides developers access to barcode scanning results.
using IronOcr;varOcr = new IronTesseract();// Enable barcode readingOcr.Configuration.ReadBarCodes = true;using (var input = new OcrInput()){ // Add an image with a barcode input.AddImage("img/Barcode.png"); varResult = Ocr.Read(input); // Iterate and print each barcode found foreach (varBarcodeinResult.Barcodes) {Console.WriteLine(Barcode.Value); // Other properties such as location and type are also accessible }}
using IronOcr;
var Ocr = new IronTesseract();
// Enable barcode reading
Ocr.Configuration.ReadBarCodes = true;
using (var input = new OcrInput())
{
// Add an image with a barcode
input.AddImage("img/Barcode.png");
var Result = Ocr.Read(input);
// Iterate and print each barcode found
foreach (var Barcode in Result.Barcodes)
{
Console.WriteLine(Barcode.Value);
// Other properties such as location and type are also accessible
}
}
ImportsIronOcrPrivateOcr = New IronTesseract()' Enable barcode readingOcr.Configuration.ReadBarCodes = TrueUsing input = New OcrInput() ' Add an image with a barcode input.AddImage("img/Barcode.png") DimResult = Ocr.Read(input) ' Iterate and print each barcode found For EachBarcodeInResult.BarcodesConsole.WriteLine(Barcode.Value) ' Other properties such as location and type are also accessible NextBarcodeEndUsing
Imports IronOcr
Private Ocr = New IronTesseract()
' Enable barcode reading
Ocr.Configuration.ReadBarCodes = True
Using input = New OcrInput()
' Add an image with a barcode
input.AddImage("img/Barcode.png")
Dim Result = Ocr.Read(input)
' Iterate and print each barcode found
For Each Barcode In Result.Barcodes
Console.WriteLine(Barcode.Value)
' Other properties such as location and type are also accessible
Next Barcode
End Using
PDF in certain images
Specifying page areas to improve efficiency and save processing time.
To use crop regions, ensure System.Drawing is imported to use System.Drawing.Rectangle.
using IronOcr;using System.Drawing;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.Latin;using (varInput = new OcrInput()){ // Define the area of interest in the image varContentArea = new Rectangle() {X = 215,Y = 1250,Height = 280,Width = 1335 // Measurements in pixels };Input.Add("document.png", ContentArea); varResult = Ocr.Read(Input);Console.WriteLine(Result.Text);}
using IronOcr;
using System.Drawing;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
// Define the area of interest in the image
var ContentArea = new Rectangle()
{
X = 215,
Y = 1250,
Height = 280,
Width = 1335 // Measurements in pixels
};
Input.Add("document.png", ContentArea);
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
ImportsIronOcrImportsSystem.DrawingDimOcrAs New IronTesseract()Ocr.Language = OcrLanguage.LatinUsingInputAs New OcrInput() ' Define the area of interest in the image DimContentAreaAs New Rectangle() With { .X = 215, .Y = 1250, .Height = 280, .Width = 1335 ' Measurements in pixels }Input.Add("document.png", ContentArea) DimResult = Ocr.Read(Input)Console.WriteLine(Result.Text)EndUsing
Imports IronOcr
Imports System.Drawing
Dim Ocr As New IronTesseract()
Ocr.Language = OcrLanguage.Latin
Using Input As New OcrInput()
' Define the area of interest in the image
Dim ContentArea As New Rectangle() With {
.X = 215,
.Y = 1250,
.Height = 280,
.Width = 1335 ' Measurements in pixels
}
Input.Add("document.png", ContentArea)
Dim Result = Ocr.Read(Input)
Console.WriteLine(Result.Text)
End Using
PDF scans for low-quality images
Use OcrInput methods to enhance the quality of scans that normal Tesseract would struggle with.
using IronOcr;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.Latin;using (varInput = new OcrInput(@"img\Potter.LowQuality.tiff")){ // Acts on the image to improve qualityInput.DeNoise(); // Removes noiseInput.Deskew(); // Corrects rotation and alignment varResult = Ocr.Read(Input);Console.WriteLine(Result.Text);}
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput(@"img\Potter.LowQuality.tiff"))
{
// Acts on the image to improve quality
Input.DeNoise(); // Removes noise
Input.Deskew(); // Corrects rotation and alignment
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
ImportsIronOcrPrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.LatinUsingInput = New OcrInput("img\Potter.LowQuality.tiff") ' Acts on the image to improve qualityInput.DeNoise() ' Removes noiseInput.Deskew() ' Corrects rotation and alignment DimResult = Ocr.Read(Input)Console.WriteLine(Result.Text)EndUsing
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Latin
Using Input = New OcrInput("img\Potter.LowQuality.tiff")
' Acts on the image to improve quality
Input.DeNoise() ' Removes noise
Input.Deskew() ' Corrects rotation and alignment
Dim Result = Ocr.Read(Input)
Console.WriteLine(Result.Text)
End Using
Export scanned PDF results as searchable PDF
PDF Image conversion into searchable, indexable PDF format.
using IronOcr;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.Latin;using (varInput = new OcrInput()){Input.Title = "Quarterly Report";Input.AddImage("image1.jpeg");Input.AddImage("image2.png");Input.AddImage("image3.gif"); varResult = Ocr.Read(Input); // Save recognized content as a searchable PDFResult.SaveAsSearchablePdf("searchable.pdf");}
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
Input.Title = "Quarterly Report";
Input.AddImage("image1.jpeg");
Input.AddImage("image2.png");
Input.AddImage("image3.gif");
var Result = Ocr.Read(Input);
// Save recognized content as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf");
}
ImportsIronOcrPrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.LatinUsingInput = New OcrInput()Input.Title = "Quarterly Report"Input.AddImage("image1.jpeg")Input.AddImage("image2.png")Input.AddImage("image3.gif") DimResult = Ocr.Read(Input) ' Save recognized content as a searchable PDFResult.SaveAsSearchablePdf("searchable.pdf")EndUsing
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Latin
Using Input = New OcrInput()
Input.Title = "Quarterly Report"
Input.AddImage("image1.jpeg")
Input.AddImage("image2.png")
Input.AddImage("image3.gif")
Dim Result = Ocr.Read(Input)
' Save recognized content as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf")
End Using
Conversion of TIFF to a searchable PDF
Convert a TIFF with an entire image set directly into a searchable PDF that can be indexed by search engines or intranet services.
using IronOcr;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.Latin;using (varInput = new OcrInput()){ // Add TIFF imagesInput.AddMultiFrameTiff("example.tiff"); varResult = Ocr.Read(Input); // Save the recognized content as a searchable PDFResult.SaveAsSearchablePdf("searchable.pdf");}
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
// Add TIFF images
Input.AddMultiFrameTiff("example.tiff");
var Result = Ocr.Read(Input);
// Save the recognized content as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf");
}
ImportsIronOcrPrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.LatinUsingInput = New OcrInput() ' Add TIFF imagesInput.AddMultiFrameTiff("example.tiff") DimResult = Ocr.Read(Input) ' Save the recognized content as a searchable PDFResult.SaveAsSearchablePdf("searchable.pdf")EndUsing
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Latin
Using Input = New OcrInput()
' Add TIFF images
Input.AddMultiFrameTiff("example.tiff")
Dim Result = Ocr.Read(Input)
' Save the recognized content as a searchable PDF
Result.SaveAsSearchablePdf("searchable.pdf")
End Using
Reproduction of HTML and export results
PDF Image prime conversion to HTML for text preservation.
using IronOcr;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.Latin;using (varInput = new OcrInput()){Input.Title = "Html Title";Input.AddImage("image1.jpeg"); varResult = Ocr.Read(Input); // Save as HOCR HTML file, useful for web pages preserving layoutResult.SaveAsHocrFile("results.html");}
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput())
{
Input.Title = "Html Title";
Input.AddImage("image1.jpeg");
var Result = Ocr.Read(Input);
// Save as HOCR HTML file, useful for web pages preserving layout
Result.SaveAsHocrFile("results.html");
}
ImportsIronOcrPrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.LatinUsingInput = New OcrInput()Input.Title = "Html Title"Input.AddImage("image1.jpeg") DimResult = Ocr.Read(Input) ' Save as HOCR HTML file, useful for web pages preserving layoutResult.SaveAsHocrFile("results.html")EndUsing
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Latin
Using Input = New OcrInput()
Input.Title = "Html Title"
Input.AddImage("image1.jpeg")
Dim Result = Ocr.Read(Input)
' Save as HOCR HTML file, useful for web pages preserving layout
Result.SaveAsHocrFile("results.html")
End Using
PDF Image Enhancement Results
IronOCR offers unique filters for OcrInput objects to enhance PDF input performance.
Example Image Code Enhancement
Enhancing input quality allows for higher accuracy and faster OCR processing.
using IronOcr;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.Latin;using (varInput = new OcrInput(@"LowQuality.jpeg")){ // Improve image readabilityInput.DeNoise(); // Clean up noisy dataInput.Deskew(); // Align the image correctly varResult = Ocr.Read(Input);Console.WriteLine(Result.Text);}
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
using (var Input = new OcrInput(@"LowQuality.jpeg"))
{
// Improve image readability
Input.DeNoise(); // Clean up noisy data
Input.Deskew(); // Align the image correctly
var Result = Ocr.Read(Input);
Console.WriteLine(Result.Text);
}
ImportsIronOcrPrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.LatinUsingInput = New OcrInput("LowQuality.jpeg") ' Improve image readabilityInput.DeNoise() ' Clean up noisy dataInput.Deskew() ' Align the image correctly DimResult = Ocr.Read(Input)Console.WriteLine(Result.Text)EndUsing
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Latin
Using Input = New OcrInput("LowQuality.jpeg")
' Improve image readability
Input.DeNoise() ' Clean up noisy data
Input.Deskew() ' Align the image correctly
Dim Result = Ocr.Read(Input)
Console.WriteLine(Result.Text)
End Using
Summary of available input enhancement filters
OcrInput.Rotate(double degrees): Rotates images clockwise by the specified degrees. Use negative values for anti-clockwise.
OcrInput.Binarize(): Converts the image to black and white, useful for high-contrast OCR cases.
OcrInput.ToGrayScale(): Converts image pixels into grayscale to improve OCR accuracy.
OcrInput.Contrast(): Increases contrast to improve text readability.
OcrInput.DeNoise(): Removes digital noise to clean up the image.
OcrInput.Invert(): Inverts all colors, turning black to white and vice versa.
OcrInput.Dilate(): Adds expansion to object boundaries, useful for dilating thin text.
OcrInput.Erode(): Reduces the boundary of objects, the opposite of dilate.
OcrInput.Deskew(): Corrects image tilt, crucial for OCR accuracy when skew exceeds 5 degrees.
OcrInput.DeepCleanBackgroundNoise(): Advanced noise removal for heavily distorted documents.
OcrInput.EnhanceResolution: Automatically upscales images with low DPI for better recognition.
Additional advanced settings in the OCR process aim to leverage unique IronOCR capabilities for optimal text scanning results.
CXXVI Supported Languages
IronOCR supports 126 languages through downloadable language packs, available for download or from NuGet Package Manager.
Language options include major languages like German, French, English, Chinese, and Japanese, with special packages for specific text, such as passport MRZ, MICR, and more.
Example using another language
Using PDF with other languages.
// using IronOcr;// PM> Install IronOcr.Languages.Arabicusing IronOcr;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.Arabic;using (var input = new OcrInput()){ input.AddImage("img/arabic.gif"); // If necessary, add image filters for quality improvement varResult = Ocr.Read(input); // Save the result to a text file for ArabicResult.SaveAsTextFile("arabic.txt");}
// using IronOcr;
// PM> Install IronOcr.Languages.Arabic
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Arabic;
using (var input = new OcrInput())
{
input.AddImage("img/arabic.gif");
// If necessary, add image filters for quality improvement
var Result = Ocr.Read(input);
// Save the result to a text file for Arabic
Result.SaveAsTextFile("arabic.txt");
}
' using IronOcr;' PM> Install IronOcr.Languages.ArabicImportsIronOcrPrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.ArabicUsing input = New OcrInput() input.AddImage("img/arabic.gif") ' If necessary, add image filters for quality improvement DimResult = Ocr.Read(input) ' Save the result to a text file for ArabicResult.SaveAsTextFile("arabic.txt")EndUsing
' using IronOcr;
' PM> Install IronOcr.Languages.Arabic
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Arabic
Using input = New OcrInput()
input.AddImage("img/arabic.gif")
' If necessary, add image filters for quality improvement
Dim Result = Ocr.Read(input)
' Save the result to a text file for Arabic
Result.SaveAsTextFile("arabic.txt")
End Using
Example using multiple languages
IronOCR can handle multiple languages simultaneously for comprehensive OCR of multilingual documents.
// using IronOcr;// PM> Install IronOcr.Languages.ChineseSimplifiedusing IronOcr;varOcr = new IronTesseract();Ocr.Language = OcrLanguage.ChineseSimplified;Ocr.AddSecondaryLanguage(OcrLanguage.Latin);// Add any number of languages as neededusing (var input = new OcrInput()){ input.Add("multi-language.pdf"); varResult = Ocr.Read(input); // Save the multilingual result to a text fileResult.SaveAsTextFile("results.txt");}
// using IronOcr;
// PM> Install IronOcr.Languages.ChineseSimplified
using IronOcr;
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.ChineseSimplified;
Ocr.AddSecondaryLanguage(OcrLanguage.Latin);
// Add any number of languages as needed
using (var input = new OcrInput())
{
input.Add("multi-language.pdf");
var Result = Ocr.Read(input);
// Save the multilingual result to a text file
Result.SaveAsTextFile("results.txt");
}
' using IronOcr;' PM> Install IronOcr.Languages.ChineseSimplifiedImportsIronOcrPrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.ChineseSimplifiedOcr.AddSecondaryLanguage(OcrLanguage.Latin)' Add any number of languages as neededUsing input = New OcrInput() input.Add("multi-language.pdf") DimResult = Ocr.Read(input) ' Save the multilingual result to a text fileResult.SaveAsTextFile("results.txt")EndUsing
' using IronOcr;
' PM> Install IronOcr.Languages.ChineseSimplified
Imports IronOcr
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.ChineseSimplified
Ocr.AddSecondaryLanguage(OcrLanguage.Latin)
' Add any number of languages as needed
Using input = New OcrInput()
input.Add("multi-language.pdf")
Dim Result = Ocr.Read(input)
' Save the multilingual result to a text file
Result.SaveAsTextFile("results.txt")
End Using
Detailed PDF Sed ea Results
Successful OCR operations return detailed results allowing further exploration and analysis beyond just recognized text.
using IronOcr;using System.Drawing; // Add assembly referencevarOcr = new IronTesseract();Ocr.Language = OcrLanguage.Latin;Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;Ocr.Configuration.ReadBarCodes = true; // Enable barcode readingusing (varInput = new OcrInput(@"images\sample.tiff")){ OcrResultResult = Ocr.Read(Input); // Explore the API for detailed information varPages = Result.Pages; varWords = Pages[0].Words; varBarcodes = Result.Barcodes; // Detailed inspection of pages, paragraphs, lines, words, and coordinates}
using IronOcr;
using System.Drawing; // Add assembly reference
var Ocr = new IronTesseract();
Ocr.Language = OcrLanguage.Latin;
Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm;
Ocr.Configuration.ReadBarCodes = true; // Enable barcode reading
using (var Input = new OcrInput(@"images\sample.tiff"))
{
OcrResult Result = Ocr.Read(Input);
// Explore the API for detailed information
var Pages = Result.Pages;
var Words = Pages[0].Words;
var Barcodes = Result.Barcodes;
// Detailed inspection of pages, paragraphs, lines, words, and coordinates
}
ImportsIronOcrImportsSystem.Drawing' Add assembly referencePrivateOcr = New IronTesseract()Ocr.Language = OcrLanguage.LatinOcr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstmOcr.Configuration.ReadBarCodes = True ' Enable barcode readingUsingInput = New OcrInput("images\sample.tiff") DimResultAsOcrResult = Ocr.Read(Input) ' Explore the API for detailed information DimPages = Result.Pages DimWords = Pages(0).Words DimBarcodes = Result.Barcodes ' Detailed inspection of pages, paragraphs, lines, words, and coordinatesEndUsing
Imports IronOcr
Imports System.Drawing ' Add assembly reference
Private Ocr = New IronTesseract()
Ocr.Language = OcrLanguage.Latin
Ocr.Configuration.EngineMode = TesseractEngineMode.TesseractAndLstm
Ocr.Configuration.ReadBarCodes = True ' Enable barcode reading
Using Input = New OcrInput("images\sample.tiff")
Dim Result As OcrResult = Ocr.Read(Input)
' Explore the API for detailed information
Dim Pages = Result.Pages
Dim Words = Pages(0).Words
Dim Barcodes = Result.Barcodes
' Detailed inspection of pages, paragraphs, lines, words, and coordinates
End Using
Performance
IronOCR is designed to work effectively out-of-the-box without the need for extensive input image modifications or performance tuning.
With improved speed: IronOCR.2020 is approximately 10 times faster than previous builds with significantly fewer errors.
Learn More
To gain a deeper understanding of OCR reproduction using C#, VB, F#, or other .NET languages, please refer to our community tutorials, which provide real-life examples and show you how to get the best out of this library.
Curtis Chau hat einen Bachelor-Abschluss in Informatik von der Carleton University und ist spezialisiert auf Frontend-Entwicklung mit Expertise in Node.js, TypeScript, JavaScript und React. Leidenschaftlich widmet er sich der Erstellung intuitiver und ästhetisch ansprechender Benutzerschnittstellen und arbeitet gerne mit modernen Frameworks sowie der Erstellung gut strukturierter, optisch ansprechender Handbücher.