wxPdfBarCodeCreator Class Reference

Class representing barcode objects. More...

#include <pdfbarcode.h>

List of all members.

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.

Protected Member Functions

wxChar 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, int len)
 Draw a barcode.
wxString EncodeCode39Ext (const wxString &code)
 Encode extended Code39 barcode.
wxChar 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.


Detailed Description

Class representing barcode objects.

All supported barcodes are drawn directly in PDF without using an image or special font.


Constructor & Destructor Documentation

wxPdfBarCodeCreator::wxPdfBarCodeCreator ( wxPdfDocument document  ) 

Constructor.

Parameters:
document associated wxPdfDocument instance

wxPdfBarCodeCreator::~wxPdfBarCodeCreator (  )  [virtual]

Destructor.


Member Function Documentation

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.

Parameters:
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.
Returns:
TRUE if barcode could be drawn, FALSE if the check digit is invalid

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.

Parameters:
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.
Returns:
TRUE if barcode could be drawn, FALSE if the check digit is invalid

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.

Parameters:
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)

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.

Parameters:
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.

Parameters:
x,: abscissa of barcode
y,: ordinate of barcode
zipcode,: zip code to draw
Returns:
TRUE if barcode could be drawn, FALSE if the zipcode is invalid

wxChar wxPdfBarCodeCreator::GetCheckDigit ( const wxString &  barcode  )  [protected]

Calculate check digit.

bool wxPdfBarCodeCreator::TestCheckDigit ( const wxString &  barcode  )  [protected]

Validate check digit.

bool wxPdfBarCodeCreator::Barcode ( double  x,
double  y,
const wxString &  barcode,
double  h,
double  w,
int  len 
) [protected]

Draw a barcode.

wxString wxPdfBarCodeCreator::EncodeCode39Ext ( const wxString &  code  )  [protected]

Encode extended Code39 barcode.

wxChar wxPdfBarCodeCreator::ChecksumCode39 ( const wxString &  code  )  [protected]

Calculate Code39 check sum.

void wxPdfBarCodeCreator::DrawCode39 ( const wxString &  code,
double  x,
double  y,
double  w,
double  h 
) [protected]

Draw Code39 barcode.

bool wxPdfBarCodeCreator::ZipCodeValidate ( const wxString &  zipcode  )  [protected]

Validate ZIP code.

int wxPdfBarCodeCreator::ZipCodeCheckSumDigit ( const wxString &  zipcode  )  [protected]

Calculate ZIP code check sum digit.

void wxPdfBarCodeCreator::ZipCodeDrawDigitBars ( double  x,
double  y,
double  barSpacing,
double  halfBarHeight,
double  fullBarHeight,
int  digit 
) [protected]

Draw ZIP code barcode.


The documentation for this class was generated from the following files:
Generated on Fri Dec 15 21:30:37 2006 for wxPdfDocument by  doxygen 1.5.1-p1