wxPdfDocument  0.9.3
Public Member Functions | Protected Member Functions
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.
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

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, unsigned 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.
void Code128Draw (double x, double y, const wxString &barcode, double h, double w)
 Draw Code128 barcode.

Detailed Description

Class representing barcode objects.

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


Constructor & Destructor Documentation

wxPdfBarCodeCreator::wxPdfBarCodeCreator ( wxPdfDocument document)

Constructor.

Parameters:
documentassociated wxPdfDocument instance
virtual wxPdfBarCodeCreator::~wxPdfBarCodeCreator ( )
virtual

Destructor.


Member Function Documentation

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

Draw a barcode.

wxChar wxPdfBarCodeCreator::ChecksumCode39 ( const wxString &  code)
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.

Parameters:
xabscissa of barcode
yordinate of barcode
barcodevalue of barcode
hheight of barcode. Default value: 13
wwidth of a bar. Default value: 0.21.
Returns:
TRUE if barcode could be drawn, FALSE if the barcode value contains invalid characters
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.

Parameters:
xabscissa of barcode
yordinate of barcode
barcodevalue of barcode
hheight of barcode. Default value: 13
wwidth of a bar. Default value: 0.21.
Returns:
TRUE if barcode could be drawn, FALSE if the barcode value contains invalid characters
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.

Parameters:
xabscissa of barcode
yordinate of barcode
barcodevalue of barcode
hheight of barcode. Default value: 13
wwidth of a bar. Default value: 0.21.
Returns:
TRUE if barcode could be drawn, FALSE if the barcode value contains invalid characters
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.

Parameters:
xabscissa of barcode
yordinate of barcode
barcodevalue of barcode
hheight of barcode. Default value: 13
wwidth of a bar. Default value: 0.21.
Returns:
TRUE if barcode could be drawn, FALSE if the barcode value contains invalid characters
void wxPdfBarCodeCreator::Code128Draw ( double  x,
double  y,
const wxString &  barcode,
double  h,
double  w 
)
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.

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)
void wxPdfBarCodeCreator::DrawCode39 ( const wxString &  code,
double  x,
double  y,
double  w,
double  h 
)
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.

Parameters:
xabscissa of barcode
yordinate of barcode
barcodevalue of barcode
hheight of barcode. Default value: 13
wwidth of a bar. Default value: 0.21.
Returns:
TRUE if barcode could be drawn, FALSE if the barcode value contains invalid characters
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:
xabscissa of barcode
yordinate of barcode
barcodevalue of barcode
hheight of barcode. Default value: 16
wwidth of a bar. Default value: 0.35.
Returns:
TRUE if barcode could be drawn, FALSE if the check digit is invalid
wxString wxPdfBarCodeCreator::EncodeCode39Ext ( const wxString &  code)
protected

Encode extended Code39 barcode.

wxChar wxPdfBarCodeCreator::GetCheckDigit ( const wxString &  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.

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
bool wxPdfBarCodeCreator::TestCheckDigit ( const wxString &  barcode)
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.

Parameters:
xabscissa of barcode
yordinate of barcode
barcodevalue of barcode
hheight of barcode. Default value: 16
wwidth of a bar. Default value: 0.35.
Returns:
TRUE if barcode could be drawn, FALSE if the check digit is invalid
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.

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

Validate ZIP code.


The documentation for this class was generated from the following file: