DynaPDF Manual - Page 501

Previous Page 500   Index   Next Page 502

Function Reference
Page 501 of 787
Human readable text
Many barcodes consist of the barcode and a human readable text portion that is mostly drawn
below the barcode. In image mode it is possible to adjust the font size and font weight with the flags
bcoSmallText and bcoBoldText. More options are not available in image mode.
In vector mode, we have more control over the text. The default font for text is the standard font
Helvetica but it is possible to change it to an arbitrary font by setting the flag bsoUseActiveFont.
When this flag is set the active font is used to output the text. This font should be loaded with the
code page cp1252 or cpUnicode. If no font is active the function falls back again to Helvetica. This font
is always available unless it was disabled with SetUseStdFonts() or SetFontSearchOrder(). Note that
the function fails with a fatal error if no font can be loaded when text must be drawn.
The function tries to achieve an almost identical result in comparison to the image version of a
barcode. This required a bit fine tuning by adjusting the font size and vertical text position. The font
size scaling factor (member FSizeFactor) is set to 0.7 by default but it can be set to values between 0.3
through 3.0. However, the text cannot become wider as the barcode. The font size will be decreased
if the text does not fit into the barcode width. Setting the scaling factor to an unneccesary large value
increases the processing time.
The vertical text position can be adjusted with the member TextOffsetY.
Special options
A few barcode types support additional flags or properties which can be set with the members
Option1 through Option3.
Unfortunately, the Zint library is completely undocumented in regard to barcode options. The
following values were taken from the source codes and maybe incomplete:
Barcode type
Member to set
Description
Supported range
bctAztec
Option1
Error correction level
-1..4
bctAztec
Option2
Symbol size
0..36
bctCodablockF
Option1
Number of rows
-1..44
bctCodablockF
Option2
Number of columns
-1, 0, 9..67
bctMaxicode
Option1
Maxicode mode
-1, 2..6
bctCodabar
Option2
Add checksum
0, 1
bctCode32
Option2
Add checksum
0, 1
bctMSIPlessey
Option2
Symbol size
0..4
bctPharmaOneTrack
Option2
Add checksum
0, 1
bctPharmaTwoTrack
Option2
Add checksum
0, 1
bctPDF417
Option1
Security value
-1..8
bctPDF417
Option2
Number of columns
0..30
bctQRCode
Option1
Error correction level
-1, 1..4
bctQRCode
Option2
Symbol size
0..40
bctQRCode
Option3
Full multibyte -> Kanji mode
unsupported
bctRSS_EXPSTACK_CC
Option1
Component linkage flag
0, 2
bctRSS_EXPSTACK_CC
Option2
Number of columns
0..11
bctUltracode
Option1
Error correction level
-1..6
bctUltracode
Option3
Ultra compression
128
 

Previous topic: Vector vs. Image Barcodes, Output resolution, Background and foreground colors

Next topic: InsertBMPFromBuffer (obsolete), InsertBMPFromHandle

Start Chat