THPDFPage.DirectDrawBarcode Method
Draws a linear barcode directly into the page content as filled rectangles, stretched to occupy the given box. Unlike DrawBarcode, it bypasses the canvas and derives the barcode width from the Width argument rather than from a module size
Declaration
procedure DirectDrawBarcode(X, Y, Width, Height: Single; const Text : AnsiString; BarcodeType : Integer);
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
X | Left-hand edge of the barcode in page coordinates |
Y | Top edge of the barcode in page coordinates |
Width | Width of the bar pattern; quiet zones are excluded |
Height | Height of the bars; POSTNET's short bars occupy the lower 40 % |
Text | The data to encode (see the usage notes) |
BarcodeType | The ordinal of a THPDFBarcodeType value: 0 Interleaved 2 of 5, 1 Industrial 2 of 5, 2 Matrix 2 of 5, 3 Code 39, 4 Code 39 Extended, 5 to 7 Code 128 A, B and C, 8 Code 93, 9 Code 93 Extended, 10 MSI, 11 POSTNET, 12 Codabar, 13 EAN-8, 14 EAN-13, 15 UPC-A, 16 and 17 UPC-E (number system 0 and 1), 18 and 19 the two- and five-digit add-ons, 20 to 22 GS1-128 with code set A, B or C. Any other value draws Code 39 |
Return value
Returns no value
Usage notes
- EAN-8, EAN-13, UPC-A and UPC-E accept just the data digits (7, 12, 11 or 6) and work out the check digit themselves; a complete number already ending in its check digit is drawn as supplied. For UPC-E the check digit is that of the expanded UPC-A number
- Interleaved 2 of 5 pads an odd digit count with a leading zero, and POSTNET appends the correction digit to a 5, 9 or 11 digit code
- Code 39 folds lower-case letters to upper case, Code 128 A reaches lower-case letters by way of SHIFT, and Codabar retains start and stop characters (A to D) framing the text, adding A and B otherwise
- Text a symbology cannot represent raises an exception rather than being drawn with characters dropped or substituted
- Leave a light quiet zone of at least ten narrow bars on either side; the fill colour is set to black
Related APIs
- THPDFPage
- THotPDF
- Contents