Print Page | Close Window

Draw text under a barcode

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: Sample Code
Forum Description: Share Debenu Quick PDF Library sample code with other forum members
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=1725
Printed Date: 07 May 24 at 12:42PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Draw text under a barcode
Posted By: Rowan
Subject: Draw text under a barcode
Date Posted: 03 Feb 11 at 6:21PM
Here is some sample code in Delphi that lets you draw text underneath a barcode.

// 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');



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk