THPDFPage.DirectDrawBarcode Method
Draws a linear barcode straight into the page content as filled rectangles, stretched to fill the given box. Unlike DrawBarcode, it does not go through a canvas and takes 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 edge of the barcode in page coordinates |
Y | Top edge of the barcode in page coordinates |
Width | Width of the bar pattern; the quiet zones are not included |
Height | Height of the bars. The short bars of POSTNET cover the lower 40 % |
Text | 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. Other values draw Code 39 |
Return value
This member does not return a value
Usage notes
- EAN-8, EAN-13, UPC-A and UPC-E take the data digits (7, 12, 11 or 6) and add the check digit themselves; a complete number that already ends in its check digit is drawn as given. The UPC-E check digit is the one of the expanded UPC-A number
- Interleaved 2 of 5 pads an odd number of digits 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 through SHIFT, and Codabar keeps start and stop characters (A to D) that frame the text, adding A and B otherwise
- Text that the symbology cannot represent raises an exception instead of being drawn with characters dropped or replaced
- Leave a light quiet zone of at least ten narrow bars on both sides; the fill color is set to black