Add a barcode to a PDF
Foxit Quick PDF Library includes support for a variety of different barcodes, including:
- Code39 (or Code 3 of 9)
- EAN-13
- Code128
- PostNet
- Interleaved 2 of 5
- Data Matrix
- Intelligent Mail Barcode (OneCode)
- PDF417
- QR Code
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.
Updated on October 13, 2023