ByteScout BarCode Generator SDK – C# – Add Barcode To PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout BarCode Generator SDK – C# – Add Barcode To PDF

ByteScout BarCode Generator SDK – C# – Add Barcode To PDF

Program.cs

using Bytescout.BarCode;

namespace AddBarcodeToPdfDocument
{
    class Program
    {
        static void Main()
        {
            // Create new barcode and register it.
            Barcode barcode = new Barcode();
            barcode.RegistrationName = "demo";
            barcode.RegistrationKey = "demo";

            // Set symbology
            barcode.Symbology = SymbologyType.DataMatrix;
            // Set value
            barcode.Value = "Sample barcode";

            // Place barcode at top-right corner of every document page
            barcode.DrawToPDF("wikipedia.pdf", -1, 500, 50, "result.pdf");

            // Open output file in default PDF viewer
            System.Diagnostics.Process.Start("result.pdf");
        }
    }
}


  Click here to get your Free Trial version of the SDK

prev
next