Read barcodes from PDF document. Barcodes can be read from PDF document by 3 ways

VeryPDF Barcode Generator & Recognition SDK/COM,

http://www.verypdf.com/app/barcode/try-and-buy.html#Buy_Barcode_Recognition_SDK

Barcodes can be read from PDF document by 3 ways:

From image resources of PDF document using VeryPDF Barcode .NET SDK.
If PDF document contains barcodes which appear on image resources of PDF page then the barcodes can be read using VeryPDF.Barcode interface. This class supports extraction of image resources encoded by:

The following algorithms:

  • ZIP
  • JPEG
  • CCITT3
  • CCITT4
  • LZW
  • Run Length

And in following color spaces:

  • DeviceGray
  • DeviceRGB
  • DeviceCMYK
  • Indexed

From image resources of PDF document using VeryPDF Imaging.NET SDK.
If PDF document contains barcodes which appear on image resources of PDF page and are encoded by algorithms or in color spaces not supported by VeryPDF Barcode .NET SDK, then such barcodes can be read using VeryPDF Imaging.NET SDK with necessary Plug-ins.

From rasterized page of PDF document using VeryPDF Imaging.NET SDK.
If PDF document contains barcodes which appear in vector form then such barcodes can be read after rasterization using VeryPDF Imaging.NET SDK with necessary Plug-ins.

image

Example: Here is an example that shows how to read barcodes from image resources of PDF document using built-in VeryPDF Barcode .NET SDK:

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 strBarcode = "CODE39";
                string strOutFile = strFolder + "\\_type2_code39.pdf";
                string strCmd = "-$ XXXXXXXXXXXXXXXXXX -type2 code39
                           -textxalign center -textyoffset 20 -textcolor FF0000
                           -paper 1000x1000 \"" + strBarcode + "\" \"" + strOutFile + "\"";
                strReturn += VeryPDFCom.GenerateBarcode(strCmd);
                nFileIndex = nFileIndex + 1;

                strBarcode = "CODE39";
                strOutFile = strFolder + "\\_type2_code39.png";
                strCmd = "-$ XXXXXXXXXXXXXXXXXX -type2 code39
                           -textxalign center -textyoffset 20 -textcolor FF0000
                           -paper 1000x1000 \"" + strBarcode + "\" \"" + strOutFile + "\"";
                strReturn += VeryPDFCom.GenerateBarcode(strCmd);
                nFileIndex = nFileIndex + 1;

                string strBarcodeFile = strFolder + "\\barcode.pdf";
                strCmd = "-$ XXXXXXXXXXXXXXXXXX -decode \"" + strBarcodeFile + "\"";
                strReturn += VeryPDFCom.GenerateBarcode(strCmd);
                nFileIndex = nFileIndex + 1;

                MessageBox.Show(strReturn);
            }
        }
    }
}

VN:F [1.9.20_1166]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.20_1166]
Rating: 0 (from 0 votes)

Related Posts

This entry was posted in Barcode Generator and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *


Verify Code   If you cannot see the CheckCode image,please refresh the page again!