Online Guide

For Using BC.NetPdfBarcodeGenerator.All
Generate and draw 2d & 1d barcodes on PDF document pages in various .NET projects.

Guide Overview

It's easy to use BC.NetPdfBarcodeGenerator.All library to generate and draw barcode symbologies on PDF file pages in your .NET/C#/VB.NET Class, Console Application, .NET WinForms, and ASP.NET web projects. Here we will show you in simple steps. Please firstly download and get the free trial library (BC.NetPdfBarcodeGeneratorTrial.All.dll). And the only thing for the integration of our library is to add your project reference to it.

BC.NetPdfBarcodeGenerator.All

We take the Console Application as an example of how to use BC.NetPdfBarcodeGenerator.All library to generate and draw 2d and 1d barcodes on PDF document pages. For ease of use, here are simple code examples for C# and VB.NET developers.

PLEASE NOTE: A demo project is included in the free trial package. Please download a trial to see more.


1. You can generate and draw 2d barcodes (QR Code, Data Matrix, PDF417) on Adobe PDF document using BC.NetPdfBarcodeGenerator.All library. (Sample: QR Code)

How to in C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BC.NetPdfBarcodeGeneratorTrial.All;

namespace BC.NetPdfBarcodeGeneratorDemo
{
    class PDFBarcodeGeneratorDemo
    {
        public static void CreateQrcodeToPDF()
        {
            PdfDoc File = new PdfDoc();
            PdfDocPage FilePage = File.AddDocPage();
            BCImage Graphics = BCImage.GetFromDocPage(FilePage);
            BCPdfBarcode barcode = new BCPdfBarcode();
            barcode.SetType = BCBarcodeSymbology.Qrcode;
            barcode.SetData = "www.barcodec.com";
            barcode.SetColor = BCColor.Black;
            barcode.SetBackgroundColor = BCColor.White;
            barcode.QrcodeECL = QrcodeECLMode.LevelL;
            barcode.SetBarcodeLocation = new BCPosition(100, 100);
            barcode.SetBarcodeSize = new BCSize(200, 200);
            barcode.GenerateBarcode(Graphics);
            File.Save("Qrcode.pdf");
            Process.Start("Qrcode.pdf");
        }
    }
}

How to in VB.NET

Imports System
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports BC.NetPdfBarcodeGeneratorTrial.All

Module PDFBarcodeGeneratorDemo1
    
    Class PDFBarcodeGeneratorDemo
        Public Shared Sub CreateQrcodeToPDF()
            Dim File As PdfDoc = New PdfDoc()
            Dim FilePage As PdfDocPage = File.AddDocPage()
            Dim Graphics As BCImage = BCImage.GetFromDocPage(FilePage)
            Dim barcode As BCPdfBarcode = New BCPdfBarcode()
            barcode.SetType = BCBarcodeSymbology.Qrcode
            barcode.SetData = "www.barcodec.com"
            barcode.SetColor = BCColor.Black
            barcode.SetBackgroundColor = BCColor.White
            barcode.QrcodeECL = QrcodeECLMode.LevelL
            barcode.SetBarcodeLocation = New BCPosition(100, 100)
            barcode.SetBarcodeSize = New BCSize(200, 200)
            barcode.GenerateBarcode(Graphics)
            File.Save("Qrcode.pdf")
            Process.Start("Qrcode.pdf")
        End Sub
    End Class
End Module

2. You can generate and draw 1d/linear barcodes on Adobe PDF document using BC.NetPdfBarcodeGenerator.All library. Support most popular symbologies including Code 128, Code 39, EAN-13, and UPC-A. (Sample: Code 39)

How to in C#

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BC.NetPdfBarcodeGeneratorTrial.All;

namespace BC.NetPdfBarcodeGeneratorDemo
{
    class PDFBarcodeGeneratorDemo
    {
        public static void CreateCode39ToPDF()
        {
            PdfDoc File = new PdfDoc();
            PdfDocPage FilePage = File.AddDocPage();
            BCImage Graphics = BCImage.GetFromDocPage(FilePage);
            BCPdfBarcode barcode = new BCPdfBarcode();
            barcode.SetType = BCBarcodeSymbology.Code39;
            barcode.SetData = "WWW.BARCODEC.COM";
            barcode.SetColor = BCColor.Black;
            barcode.SetBackgroundColor = BCColor.White;
            barcode.SetTextVisible = true;
            barcode.SetBarcodeLocation = new BCPosition(100, 100);
            barcode.SetBarcodeSize = new BCSize(200, 50);
            barcode.GenerateBarcode(Graphics);
            File.Save("Code39.pdf");
            Process.Start("Code39.pdf");
        }
    }
}

How to in VB.NET

Imports System
Imports System.Collections.Generic
Imports System.Diagnostics
Imports System.Linq
Imports System.Text
Imports System.Threading.Tasks
Imports BC.NetPdfBarcodeGeneratorTrial.All

Module PDFBarcodeGeneratorDemo1
    
    Class PDFBarcodeGeneratorDemo
        Public Shared Sub CreateCode39ToPDF()
            Dim File As PdfDoc = New PdfDoc()
            Dim FilePage As PdfDocPage = File.AddDocPage()
            Dim Graphics As BCImage = BCImage.GetFromDocPage(FilePage)
            Dim barcode As BCPdfBarcode = New BCPdfBarcode()
            barcode.SetType = BCBarcodeSymbology.Code39
            barcode.SetData = "WWW.BARCODEC.COM"
            barcode.SetColor = BCColor.Black
            barcode.SetBackgroundColor = BCColor.White
            barcode.SetTextVisible = True
            barcode.SetBarcodeLocation = New BCPosition(100, 100)
            barcode.SetBarcodeSize = New BCSize(200, 50)
            barcode.GenerateBarcode(Graphics)
            File.Save("Code39.pdf")
            Process.Start("Code39.pdf")
        End Sub
    End Class
End Module

Please Note

Examples for generating all 1D/linear and 2D barcodes on PDF document are provided in our free trial package. You can download a free trial to see more.