DynaPDF Manual - Page 531

Previous Page 530   Index   Next Page 532

Function Reference
Page 531 of 839
bcoDottyMode
= 0x00000100, // Plot a matrix symbol using dots rather than squares.
bcoGS1_GS_Separator = 0x00000200, // Use GS instead FNC1 as GS1 separator.
bcoImageOutput
= 0x01000000, // Draw the barcode as an image.
bcoUseActiveFont
= 0x02000000
// Vector output only. If set, text is output with the active
// font. Helvetica is used otherwise.
}TBarcodeOptions;
struct TPDFBarcode2
{
UI32
StructSize;
// Must be set to sizeof(TPDFBarcode2).
TPDFBarcodeType
BarcodeType; // The type of barcode that should be created.
UI32
BgColor;
// Background color -> Default NO_COLOR (transparent).
UI32
BorderWidth; // Border width -> default 0.
const char*
Data;
// Required: Data string.
TPDFBarcodeDataType DataType;
// Data type and escape flag.
float
DotSize;
// Dotty mode only -> Default 4.0/5.0.
SI32
Eci;
// Extended Channel Interpretation mode -> Default 0.
UI32
FgColor;
// RGB Foreground color -> Default 0.
float
FSizeFactor; // Font size correction factor -> Default 0.7.
SI32
Option1;
// Various, depends on barcode type. -> Default -1.
SI32
Option2;
// Various, depends on barcode type. -> Default 0.
SI32
Option3;
// Various, depends on barcode type. -> Default 0.
TPDFBarcodeOptions
Options;
// Output options.
SI32
Orientation; // Supported values: 0, 90, -90, 180, -180, 270, -270.
const char*
Primary;
// Composite codes only. Primary data message (max 127 bytes).
float
Scale;
// Image based barcodes only. Default 1.0.
LBOOL
ShowText;
// Show human readable text? Default true.
UI32
SpaceWidth;
// Whitespace width in pixels -> Default 0 (auto).
UI32
SymbHeight;
// Default 50.
float
TextOffsetY; // Offset to correct the y-coordinate of text -> Default 0.
struct TFltRect
OuterBorder; // Optional border around the scaled barcode measured in user
// space. The border is drawn in BgColor.
};
The function inserts a barcode to the current open page. The creation of a barcode starts with the
initialisation of the structure TPDFBarcode2 with InitBarcode2(). However, before we can call
InitBarcode2(), StructSize must be set to sizeof(TPDFBarcode2) (C/C++ only). This is required
because the structure size is used to identify different versions of the structure.
After the structure was initialized, the barcode type and data must be set. Composite barcodes
require also a primary message (member Primary) but that's it, most barcode types can already be
created with this minimal initialisation.
Although it is possible to create barcodes with pure default values, we want now take a deeper look
into the barcode options and available flags.
Output position and orientation
Because every barcode has a distinct size that is usually unknown, a barcode is placed into a
destination rectangle. If the coordinate system is bottom-up the point PosX, PosY defines the lower
left corner of the output rectangle. If the coordinate system is top-down it defines the upper left
corner.
The barcode is horizontally and vertically aligned into the output rectangle according to the values
of HAlign and VAlign.
The barcode can also be rotated in 90 degrees steps with the member Orientation. Note that the
barcode will be rotated and not the output rectangle!
 

Previous topic: InsertBarcode

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