LEADTOOLS Barcode C++ Class Library Help > Quick Reference > Data Types > BARCODEWRITEPDF |
typedef struct tagBarCodeWritePDF
{
L_UINT uStructSize;
L_UINT16 wEccPerc;
L_UINT16 wEccLevel;
L_UINT16 wAspectHeight;
L_UINT16 wAspectWidth;
L_UINT16 wModAspectRatio;
L_UINT16 wColumns;
L_UINT16 wRows;
L_UINT16 wModule;
L_INT nJustify;
} BARCODEWRITEPDF, * pBARCODEWRITEPDF;
This structure contains PDF417/MicroPDF417 symbol information.
Member |
Description |
|
uStructSize |
Size of the BARCODEWRITEPDF structure, in bytes, for versioning. Use the sizeof() macro to calculate the value. |
|
wEccPerc |
Determines the ECC character percentage. This will be used when wEccLevel is BARCODE_PDF417_ECCUSE_PERCENT. Only used with PDF417. |
|
wEccLevel |
Determines the ECC level for writing a PDF417 symbol. Possible values are: |
|
Value |
Meaning |
|
BARCODE_PDF417_ECCLEVEL_0 |
[0x0001] Use ECC level 0. This uses 2 code words for error correction. |
|
BARCODE_PDF417_ECCLEVEL_1 |
[0x0002] Use ECC level 0. This uses 4 code words for error correction. |
|
BARCODE_PDF417_ECCLEVEL_2 |
[0x0004] Use ECC level 0. This uses 8 code words for error correction. |
|
BARCODE_PDF417_ECCLEVEL_3 |
[0x0008] Use ECC level 0. This uses 16 code words for error correction. |
|
BARCODE_PDF417_ECCLEVEL_4 |
[0x0010] Use ECC level 0. This uses 32 code words for error correction. |
|
BARCODE_PDF417_ECCLEVEL_5 |
[0x0020] Use ECC level 0. This uses 64 code words for error correction. |
|
BARCODE_PDF417_ECCLEVEL_6 |
[0x0040] Use ECC level 0. This uses 128 code words for error correction. |
|
BARCODE_PDF417_ECCLEVEL_7 |
[0x0080] Use ECC level 0. This uses 256 code words for error correction. |
|
BARCODE_PDF417_ECCLEVEL_8 |
[0x0100] Use ECC level 0. This uses 512 code words for error correction. |
|
BARCODE_PDF417_ECCUSE_PERCENT |
[0x0FFF] Use the percentage to determine the ECC level. |
|
wAspectHeight |
The height of the aspect ratio of the symbol. Only used with PDF417. |
|
wAspectWidth |
The width of the aspect ratio of the symbol. Only used with PDF417. |
|
wModAspectRatio |
Specifies the ratio of the width of the smallest element (wModule) to the height of a row of the PDF417 symbol. |
|
wColumns |
Number of columns for writing a PDF417 or MicroPDF417 symbol. When the BARCODE_COLROWASLIMITS flag is set, the function will not use wAspectHeight. |
|
wRows |
Number of rows for writing a PDF417 or MicroPDF417 symbol. When the BARCODE_COLROWASLIMITS flag is set, the function will not use wAspectWidth. |
|
wModule |
The size of the smallest element in width, specified in thousandths of an inch (0.001). If the value is too small, a minimum of 2 pixels will be used. |
nJustify |
Determines the alignment (justification) of the resulting barcode symbols. You can combine values when appropriate, by using a bitwise OR ( | ). The following are valid values: |
|
Value |
Meaning |
|
BARCODE_JUSTIFY_RIGHT |
[0x1000] Justifies the PDF417/MicroPDF417 symbol to the right side of the bitmap. |
|
BARCODE_JUSTIFY_H_CENTER |
[0x2000] Justifies the PDF417/MicroPDF417 symbol in the horizontal center of the bitmap. |
|
BARCODE_JUSTIFY_BOTTOM |
[0x4000] Justifies the PDF417/MicroPDF417 symbol to the bottom side of the bitmap. |
|
BARCODE_JUSTIFY_V_CENTER |
[0x8000] Justifies the PDF417/MicroPDF417 symbol in the vertical center of the bitmap. |
Comments
pBARCODEWRITEPDF is a pointer to an BARCODEWRITEPDF structure. Where the function parameter type is pBARCODEWRITEPDF, you can declare a BARCODEWRITEPDF variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pBARCODEWRITEPDF variable is necessary only if your program requires a pointer.
A PDF417 barcode size is dependent on the following values:
Number of Columns
Number of Rows
X Module Size
Module Aspect Ratio
To calculate barcode Width use the following equation:
Width= ((Number of Columns * 17) + 73) * (X Module Size)
This includes the Quiet Zone, Indicators, Start and Stop patterns.
To calculate barcode Height use the following equation:
Height=(Number of Rows + 4) * (X Module Size) * (Module Aspect Ratio)
The 4 added to Number of Rows is to account for the Quiet Zone.
If the number of columns and rows are not specified the default behavior is to find the minimum number of columns that the data requires to fit in its rows.
The Quiet Zone for a barcode is a minimum required white space before the start of the barcode symbols. The purpose is to delineate non-barcode information from the barcode data to prevent a reader from picking up information that doesnt pertain to the barcode. For a PDF417 the Quiet Zone is 2 Modules on each side.
AspectHeight and AspectWidth properties are needed in special case when the number of barcode codewords equal to 4 (i.e. small barcodes).
If there isnt a valid row column combination available to fit the encoded data or if the number of the specified columns and rows cannot fit the data. The function will return "Function Not Successful".
For a table containing information useful when writing PDF417 barcode data see http://www.leadtools.com/sdk/document/document-addon-barcodepdf-chart.htm.
MicroPDF417 may only be printed in certain defined combinations of rows and columns. Possible values are (wColumns x wRows):
0 x 0 (Default)
1 x 11
1 x 14
1 x 17
1 x 20
1 x 24
1 x 28
2 x 8
2 x 11
2 x 14
2 x 17
2 x 20
2 x 23
2 x 26
3 x 6
3 x 8
3 x 10
3 x 12
3 x 15
3 x 20
3 x 26
3 x 32
3 x 38
3 x 44
4 x 4
4 x 6
4 x 8
4 x 10
4 x 12
4 x 15
4 x 20
4 x 26
4 x 32
4 x 38
4 x 44