This article shows how to use VeryPDF Barcode Recognition SDK to recognize barcodes from PDF documents.
https://www.verypdf.com/app/barcode/barcode-recognition.html
Recognizing Barcodes from PDF Files, Extract Images from PDF Document and Read Barcodes.
- Extract images from the PDF document using VeryPDF Barcode Recognition SDK.
- Pass the images to VeryPDF Barcode Recognition SDK for barcode recognition.
Below is a complete C# program that generates and recognizes barcodes from Adobe PDF documents,
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using VeryPDF;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
string appPath = Path.GetDirectoryName(Application.ExecutablePath);
{
System.Type VeryPDFType =
System.Type.GetTypeFromProgID("VeryPDF.BarcodeCom");
VeryPDF.BarcodeCom VeryPDFCom = (VeryPDF.BarcodeCom)
System.Activator.CreateInstance(VeryPDFType);
string appFolder = Path.GetDirectoryName(Application.ExecutablePath);
string strFolder = appFolder;
string strReturn = "";
int nFileIndex = 0;
VeryPDFCom.EnableDebugLog(true);
string strBarcodeFile = strFolder + "\\barcode.pdf";
string strCmd = "-$ XXXXXXXXXXXXXXXXXX -decode \""
+ strBarcodeFile + "\"";
strReturn += VeryPDFCom.GenerateBarcode(strCmd);
nFileIndex = nFileIndex + 1;
MessageBox.Show(strReturn);
}
}
}
}