Back to Blog

    Developer Blog

    Add a barcode to a PDF

    Foxit Quick PDF Library

    Foxit Quick PDF Library includes support for a variety of different barcodes, including:

    Below is some C# sample code that demonstrates how to use the DrawBarcode function to draw some of the barcodes listed above. The last three barcode types listed above have their own functions.

    /* Draw a variety of different barcodes on a new page in a PDF */
    
    // Set the origin for the co-ordinates to be
    // the top left corner of the page.
    
    DPL.SetOrigin(1);
    
    // Draw three different barcodes
    
    DPL.DrawBarcode(25, 25, 150, 100, "MyBarcode256", 1, 0);
    DPL.DrawBarcode(225, 50, 100, 600, "MyBarcode257/RC", 1, 0);
    DPL.DrawBarcode(350, 50, 200, 150, "MyBarcode258", 3, 0);
    
    // Save the new file to the output folder
    
    DPL.SaveToFile("Barcodes.pdf");
    

    This article refers to a deprecated product. If you are looking for support for Foxit PDF SDK, please click here.