Frequently Asked Question:
Draw text under a barcode
How do I draw text underneath a barcode?
Currently only the EAN-13 barcode in Quick PDF Library draws the text at the bottom (it has to line the text up very carefully). For the other barcode types no text is drawn. This is by design as it is quite tough to get the text in a position that would suit all customers.
However, here is some sample code in Delphi that lets you draw text underneath a barcode. It can be modified as required to accommodate everyones needs.
// Add the Helvetica standard font
QP.AddStandardFont(4);
// Get the width of the barcode with a bar width of 1 unit
BarcodeWidth := QP.GetBarcodeWidth(1, '12345', 1);
// Draw the barcode
QP.DrawBarcode(100, 500, BarcodeWidth, 100, '12345', 1, 0);
// Center the text
QP.SetTextAlign(1);
// Draw the text at 10pt
QP.SetTextSize(10);
QP.DrawText(100 + BarcodeWidth / 2, 500 - 200 - 5 - QP.GetTextHeight, '12345');