如何在 C# 中用 OCR 阅读条码和二维码

How to Read Barcodes and QR Codes

This article was translated from English: Does it need improvement?
Translated
View the article in English

使用 OCR 技术读取条形码和 QR 码,在这些代码是印刷或数字文档的一部分并需要自动处理的情况下非常有用。 它可以实现自动化并从多种来源提取数据,是企业和开发人员的多功能解决方案。

as-heading:2(快速入门:立即从 PDF 中读取 BarCode)</em

只需一个设置即可启用条形码检测,使用 IronOCR 可以毫不费力地扫描 PDF。 下面的代码展示了如何在几行代码中打开条形码读取、处理 PDF 并立即检索解码值。

Nuget IconGet started making PDFs with NuGet now:

  1. Install IronOCR with NuGet Package Manager

    PM > Install-Package IronOcr

  2. Copy and run this code snippet.

    var result = new IronOcr.IronTesseract() { Configuration = new IronOcr.TesseractConfiguration { ReadBarCodes = true } }.Read(new IronOcr.OcrPdfInput("document.pdf"));
    foreach(var bc in result.Barcodes) Console.WriteLine(bc.Value);
  3. Deploy to test on your live environment

    Start using IronOCR in your project today with a free trial
    arrow pointer