wxPdfDocument 1.2.0
Public Member Functions | Protected Member Functions | List of all members
wxPdfBarCodeCreator Class Reference

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.
 

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::wxPdfBarCodeCreator ( wxPdfDocument & document)

Constructor.

Parameters
documentassociated wxPdfDocument instance

◆ ~wxPdfBarCodeCreator()

virtual wxPdfBarCodeCreator::~wxPdfBarCodeCreator ( )
virtual

Destructor.

Member Function Documentation

◆ Barcode()

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

Draw a barcode.

◆ ChecksumCode39()

wxUniChar wxPdfBarCodeCreator::ChecksumCode39 ( const wxString & code)
protected

Calculate Code39 check sum.

◆ Code128()

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

◆ Code128A()

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

◆ Code128B()

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

◆ Code128C()

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

◆ Code128Draw()

void wxPdfBarCodeCreator::Code128Draw ( double x,
double y,
const wxString & barcode,
double h,
double w )
protected

Draw Code128 barcode.

◆ Code39()

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
xabscissa
yordinate
codebarcode value
extindicates if extended mode must be used (true by default)
cksindicates if a checksum must be appended (false by default)
wwidth of a narrow bar (0.4 by default)
hheight of bars (20 by default)
wideindicates if ratio between wide and narrow bars is high; if yes, ratio is 3, if no, it's 2 (true by default)

◆ DrawCode39()

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

Draw Code39 barcode.

◆ EAN128()

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

◆ EAN13()

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

◆ EncodeCode39Ext()

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

Encode extended Code39 barcode.

◆ GetCheckDigit()

wxUniChar wxPdfBarCodeCreator::GetCheckDigit ( const wxString & barcode)
protected

Calculate check digit.

◆ I25()

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
xposabscissa of barcode
yposordinate of barcode
codevalue of barcode (Note: if the length of the code is not even, a 0 is preprended.)
basewidthcorresponds to the width of a wide bar (defaults to 1)
heightbar height (defaults to 10)

◆ PostNet()

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
xabscissa of barcode
yordinate of barcode
zipcodezip code to draw
Returns
TRUE if barcode could be drawn, FALSE if the zipcode is invalid

◆ TestCheckDigit()

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

Validate check digit.

◆ UPC_A()

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

◆ ZipCodeCheckSumDigit()

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

Calculate ZIP code check sum digit.

◆ ZipCodeDrawDigitBars()

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

Draw ZIP code barcode.

◆ ZipCodeValidate()

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

Validate ZIP code.


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