Read barcodes from PDF with Bytescout BarCode Reader SDK in C# and VB.NET - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

Read barcodes from PDF with Bytescout BarCode Reader SDK in C# and VB.NET

  • Home
  • /
  • Articles
  • /
  • Read barcodes from PDF with Bytescout BarCode Reader SDK in C# and VB.NET

This sample demonstrates how to read barcode from PDF using BarCode Reader SDK in Visual C# and Visual Basic .NET and ASP.NET

You can find the full source code of this sample in ExamplesAdvanced ExamplesAdvancedBarcodes From PDF folder of Bytescout BarCode Reader SDK installation.

Visual Basic .NET (VB.NET)

Imports System.Drawing
Imports Bytescout.BarCodeReader

Class Program
	Friend Shared Sub Main(args As String())
        Dim barcodeReader As New Reader()
		Dim imgNum As Integer = 1

        Console.WriteLine("Reading barcode(s) from image #{0}", imgNum)

        Dim barcodes As FoundBarcode() = barcodeReader.ReadFrom("example.pdf")

        For Each barcode As FoundBarcode In barcodes
            Console.WriteLine("   Found barcode with type '{0}' and value '{1}'", barcode.Type, barcode.Value)
        Next

        Console.WriteLine()
        Console.WriteLine("Press any key to continue.")
        Console.ReadKey()
	End Sub
End Class

Visual C# .NET (C# .NET)

using System;
using System.Drawing;
using Bytescout.BarCodeReader;

namespace BarcodesFromPDF
{
	class Program
	{
		static void Main(string[] args)
		{
			Reader barcodeReader = new Reader();
			int imgNum = 1;

					Console.WriteLine("Reading barcode(s) from PDF");

					FoundBarcode[] barcodes = barcodeReader.ReadFrom("example.pdf");

					foreach (FoundBarcode barcode in barcodes)
						Console.WriteLine("   Found barcode with type '{0}' and value '{1}'", barcode.Type, barcode.Value);

			Console.WriteLine();
			Console.WriteLine("Press any key to continue.");
			Console.ReadKey();
		}
	}
}

Tutorials:

prev
next