1. Home
  2. Foxit Quick PDF Library
  3. Add a barcode to a PDF

Add a barcode to a PDF

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");
Updated on April 10, 2017

Was this article helpful?

Related Articles

Ready to try Foxit PDF SDK?
Click the link below to download your trial
Free Trial

Leave a Comment