wxPdfDocument 1.2.0
|
Class representing barcode objects. More...
#include <pdfbarcode.h>
Public Member Functions | |
wxPdfBarCodeCreator (wxPdfDocument &document) | |
Constructor. | |
virtual | ~wxPdfBarCodeCreator () |
Destructor. | |
bool | EAN13 (double x, double y, const wxString &barcode, double h=16, double w=.35) |
Draw a EAN13 barcode. | |
bool | UPC_A (double x, double y, const wxString &barcode, double h=16, double w=.35) |
Draw a UPC-A barcode. | |
bool | Code39 (double x, double y, const wxString &code, bool ext=true, bool cks=false, double w=0.4, double h=20, bool wide=true) |
Draw standard or extended Code39 barcode. | |
bool | I25 (double xpos, double ypos, const wxString &code, double basewidth=1, double height=10) |
Draw an Interleaved 2 of 5 barcode. | |
bool | PostNet (double x, double y, const wxString &zipcode) |
Draw U.S. Postal Service POSTNET barcodes. | |
bool | Code128 (double x, double y, const wxString &barcode, double h, double w=0.21) |
Draw a Code128 barcode automatically switching the code sets as needed. | |
bool | Code128A (double x, double y, const wxString &barcode, double h=13, double w=0.21) |
Draw a Code128 barcode using only code set A. | |
bool | Code128B (double x, double y, const wxString &barcode, double h=13, double w=0.21) |
Draw a Code128 barcode using only code set B. | |
bool | Code128C (double x, double y, const wxString &barcode, double h=13, double w=0.21) |
Draw a Code128 barcode using only code set C. | |
bool | EAN128 (double x, double y, const wxString &barcode, double h, double w=0.21) |
Draw a EAN128 barcode. | |
Protected Member Functions | |
wxUniChar | GetCheckDigit (const wxString &barcode) |
Calculate check digit. | |
bool | TestCheckDigit (const wxString &barcode) |
Validate check digit. | |
bool | Barcode (double x, double y, const wxString &barcode, double h, double w, unsigned int len) |
Draw a barcode. | |
wxString | EncodeCode39Ext (const wxString &code) |
Encode extended Code39 barcode. | |
wxUniChar | ChecksumCode39 (const wxString &code) |
Calculate Code39 check sum. | |
void | DrawCode39 (const wxString &code, double x, double y, double w, double h) |
Draw Code39 barcode. | |
bool | ZipCodeValidate (const wxString &zipcode) |
Validate ZIP code. | |
int | ZipCodeCheckSumDigit (const wxString &zipcode) |
Calculate ZIP code check sum digit. | |
void | ZipCodeDrawDigitBars (double x, double y, double barSpacing, double halfBarHeight, double fullBarHeight, int digit) |
Draw ZIP code barcode. | |
void | Code128Draw (double x, double y, const wxString &barcode, double h, double w) |
Draw Code128 barcode. | |
Class representing barcode objects.
All supported barcodes are drawn directly in PDF without using an image or a special font.
wxPdfBarCodeCreator::wxPdfBarCodeCreator | ( | wxPdfDocument & | document | ) |
Constructor.
document | associated wxPdfDocument instance |
|
virtual |
Destructor.
|
protected |
Draw a barcode.
|
protected |
Calculate Code39 check sum.
bool wxPdfBarCodeCreator::Code128 | ( | double | x, |
double | y, | ||
const wxString & | barcode, | ||
double | h, | ||
double | w = 0.21 ) |
Draw a Code128 barcode automatically switching the code sets as needed.
A Code128 barcode consists of characters in the range from ASCII code 0 to 127. Special function codes FNC1, FNC2, FNC3, FNC4 are supported as well.
x | abscissa of barcode |
y | ordinate of barcode |
barcode | value of barcode |
h | height of barcode. Default value: 13 |
w | width of a bar. Default value: 0.21. |
bool wxPdfBarCodeCreator::Code128A | ( | double | x, |
double | y, | ||
const wxString & | barcode, | ||
double | h = 13, | ||
double | w = 0.21 ) |
Draw a Code128 barcode using only code set A.
A Code128A barcode consists of characters in the range from ASCII code 0 to 95. Special function codes FNC1, FNC2, FNC3, FNC4 are supported as well.
x | abscissa of barcode |
y | ordinate of barcode |
barcode | value of barcode |
h | height of barcode. Default value: 13 |
w | width of a bar. Default value: 0.21. |
bool wxPdfBarCodeCreator::Code128B | ( | double | x, |
double | y, | ||
const wxString & | barcode, | ||
double | h = 13, | ||
double | w = 0.21 ) |
Draw a Code128 barcode using only code set B.
A Code128B barcode consists of characters in the range from ASCII code 32 to 127. Special function codes FNC1, FNC2, FNC3, FNC4 are supported as well.
x | abscissa of barcode |
y | ordinate of barcode |
barcode | value of barcode |
h | height of barcode. Default value: 13 |
w | width of a bar. Default value: 0.21. |
bool wxPdfBarCodeCreator::Code128C | ( | double | x, |
double | y, | ||
const wxString & | barcode, | ||
double | h = 13, | ||
double | w = 0.21 ) |
Draw a Code128 barcode using only code set C.
A Code128C barcode consists of decimal digits characters only.
x | abscissa of barcode |
y | ordinate of barcode |
barcode | value of barcode |
h | height of barcode. Default value: 13 |
w | width of a bar. Default value: 0.21. |
|
protected |
Draw Code128 barcode.
bool wxPdfBarCodeCreator::Code39 | ( | double | x, |
double | y, | ||
const wxString & | code, | ||
bool | ext = true, | ||
bool | cks = false, | ||
double | w = 0.4, | ||
double | h = 20, | ||
bool | wide = true ) |
Draw standard or extended Code39 barcode.
This method supports both standard and extended Code 39 barcodes. The extended mode gives access to the full ASCII range (from 0 to 127). It is also possible to add a checksum.
x | abscissa |
y | ordinate |
code | barcode value |
ext | indicates if extended mode must be used (true by default) |
cks | indicates if a checksum must be appended (false by default) |
w | width of a narrow bar (0.4 by default) |
h | height of bars (20 by default) |
wide | indicates if ratio between wide and narrow bars is high; if yes, ratio is 3, if no, it's 2 (true by default) |
|
protected |
Draw Code39 barcode.
bool wxPdfBarCodeCreator::EAN128 | ( | double | x, |
double | y, | ||
const wxString & | barcode, | ||
double | h, | ||
double | w = 0.21 ) |
Draw a EAN128 barcode.
AI codes are supported.
x | abscissa of barcode |
y | ordinate of barcode |
barcode | value of barcode |
h | height of barcode. Default value: 13 |
w | width of a bar. Default value: 0.21. |
bool wxPdfBarCodeCreator::EAN13 | ( | double | x, |
double | y, | ||
const wxString & | barcode, | ||
double | h = 16, | ||
double | w = .35 ) |
Draw a EAN13 barcode.
An EAN13 barcode is made up of 13 digits, The last digit is a check digit; if it's not supplied, it will be automatically computed.
x | abscissa of barcode |
y | ordinate of barcode |
barcode | value of barcode |
h | height of barcode. Default value: 16 |
w | width of a bar. Default value: 0.35. |
|
protected |
Encode extended Code39 barcode.
|
protected |
Calculate check digit.
bool wxPdfBarCodeCreator::I25 | ( | double | xpos, |
double | ypos, | ||
const wxString & | code, | ||
double | basewidth = 1, | ||
double | height = 10 ) |
Draw an Interleaved 2 of 5 barcode.
An Interleaved 2 of 5 barcode contains digits (0 to 9) and encodes the data in the width of both bars and spaces. It is used primarily in the distribution and warehouse industry.
xpos | abscissa of barcode |
ypos | ordinate of barcode |
code | value of barcode (Note: if the length of the code is not even, a 0 is preprended.) |
basewidth | corresponds to the width of a wide bar (defaults to 1) |
height | bar height (defaults to 10) |
bool wxPdfBarCodeCreator::PostNet | ( | double | x, |
double | y, | ||
const wxString & | zipcode ) |
Draw U.S. Postal Service POSTNET barcodes.
This method supports both 5 and 9 digit zip codes. Zipcode must be a string containing a zip code of the form DDDDD or DDDDD-DDDD.
x | abscissa of barcode |
y | ordinate of barcode |
zipcode | zip code to draw |
|
protected |
Validate check digit.
bool wxPdfBarCodeCreator::UPC_A | ( | double | x, |
double | y, | ||
const wxString & | barcode, | ||
double | h = 16, | ||
double | w = .35 ) |
Draw a UPC-A barcode.
An UPC-A barcode is made up of 12 digits (leading zeroes are added if necessary). The last digit is a check digit; if it's not supplied, it will be automatically computed.
x | abscissa of barcode |
y | ordinate of barcode |
barcode | value of barcode |
h | height of barcode. Default value: 16 |
w | width of a bar. Default value: 0.35. |
|
protected |
Calculate ZIP code check sum digit.
|
protected |
Draw ZIP code barcode.
|
protected |
Validate ZIP code.