PDF .NET Library Logo
Home Products Code Library Online Demos Support Forum Buy About Us  
Code Library

How to draw 2D-Barcodes

The code sample below draws 2D barcodes on a PDF page

c# sample:

PDFDocument doc = new PDFDocument("barcode.pdf");

PDFTech.Barcodes.Barcode2D.DataMatrix dataMatrix = new PDFTech.Barcodes.Barcode2D.DataMatrix("123456789 PDFTech", UnitOfMeasure.Pixel);

dataMatrix.SymbolSize = PDFTech.Barcodes.DataMatrixSymbolSize.Size40X40;

if (dataMatrix.IsCodeValid())

{

      doc.CurrentPage.Body.Add2DBarcode(dataMatrix,130, 100);

}

if (!doc.Save())

      Console.WriteLine(doc.Error);    

Back to PDF Code Library