foxit::common::Barcode Class Reference
Inheritance diagram for foxit::common::Barcode:
foxit::Base

Public Types

enum  Format {
  e_FormatCode39 = 0, e_FormatCode128 = 1, e_FormatEAN8 = 2, e_FormatUPCA = 3,
  e_FormatEAN13 = 4, e_FormatITF = 5, e_FormatPDF417 = 6, e_FormatQRCode = 7
}
 Enumeration for barcode format. More...
 
enum  QRErrorCorrectionLevel { e_QRCorrectionLevelLow = 0, e_QRCorrectionLevelMedium = 1, e_QRCorrectionLevelQuater = 2, e_QRCorrectionLevelHigh = 3 }
 Enumeration for format error correction level of QR Code. More...
 

Public Member Functions

 Barcode ()
 Constructor.
 
 Barcode (const Barcode &other)
 Constructor, with another Barcode object. More...
 
 ~Barcode ()
 Destructor.
 
common::Bitmap GenerateBitmap (const WString &info, Format format, int32 unit_width, int32 unit_height, QRErrorCorrectionLevel level)
 Generate a barcode bitmap with a given information string and specified barcode format. More...
 
bool IsEmpty () const
 Check whether current object is empty or not. More...
 
bool operator!= (const Barcode &other) const
 Not equal operator. More...
 
Barcodeoperator= (const Barcode &other)
 Assign operator. More...
 
bool operator== (const Barcode &other) const
 Equal operator. More...
 
- Public Member Functions inherited from foxit::Base
FS_HANDLE Handle () const
 Get the handle of current object. More...
 

Detailed Description

This class can be used to generate barcode bitmap.

Member Enumeration Documentation

◆ Format

Enumeration for barcode format.

Values of this enumeration should be used alone.

Enumerator
e_FormatCode39 

Barcode format: standard 39 code.

e_FormatCode128 

Barcode format: Code128, including EAN128 code.

e_FormatEAN8 

Barcode format: EAN-8 code.

e_FormatUPCA 

Barcode format: UPC-A code.

e_FormatEAN13 

Barcode format: EAN-13 code.

e_FormatITF 

Barcode format: ITF code.

e_FormatPDF417 

Barcode format: PDF-417 code.

e_FormatQRCode 

Barcode format: Quick Response Code.

◆ QRErrorCorrectionLevel

Enumeration for format error correction level of QR Code.

Values of this enumeration should be used alone.

Enumerator
e_QRCorrectionLevelLow 

The capability of recovery from 7% amounts of damage.

e_QRCorrectionLevelMedium 

The capability of recovery from 15% amounts of damage.

e_QRCorrectionLevelQuater 

The capability of recovery from 25% amounts of damage.

e_QRCorrectionLevelHigh 

The capability of recovery from 30% amounts of damage.

Constructor & Destructor Documentation

◆ Barcode()

foxit::common::Barcode::Barcode ( const Barcode other)

Constructor, with another Barcode object.

Parameters
[in]otherAnother Barcode object.

Member Function Documentation

◆ GenerateBitmap()

common::Bitmap foxit::common::Barcode::GenerateBitmap ( const WString info,
Format  format,
int32  unit_width,
int32  unit_height,
QRErrorCorrectionLevel  level 
)

Generate a barcode bitmap with a given information string and specified barcode format.

Parameters
[in]infoInformation string to be encoded to barcode bitmap. It should not be an empty string.
[in]formatBarcode format which is used to encode information string. Please refer to values starting from Barcode::e_FormatCode39 and this should be one of these values.
[in]unit_widthUnit width for barcode, in pixels. Valid values: from 1 to 5. If input value is below 1, 1 will be used by default; if input value is above 5, 5 will be used by default.
Specially, for PDF-417 and QR Code, the minimum value of unit_width and unit_height will be used as unit width (compared with valid value range) and unit height will be ignored.
[in]unit_heightUnit height for barcode, in pixels. Valid values: equal to or above 20. If input value is below 20, 20 will be used by default.
Specially, for PDF-417 and QR Code, the minimum value of unit_width and unit_height will be used as unit width (compared with valid value range) and unit height will be ignored.
[in]level(Required only for QR Code) Error correction level. Please refer to values starting from Barcode::e_QRCorrectionLevelLow and this should be one of these values.
Returns
A barcode bitmap.

◆ IsEmpty()

bool foxit::common::Barcode::IsEmpty ( ) const

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ operator!=()

bool foxit::common::Barcode::operator!= ( const Barcode other) const

Not equal operator.

Parameters
[in]otherAnother Barcode object. This function will check if current object is not equal to this one.
Returns
true means not equal, while false means equal.

◆ operator=()

Barcode& foxit::common::Barcode::operator= ( const Barcode other)

Assign operator.

Parameters
[in]otherAnother Barcode object, whose value would be assigned to current object.
Returns
Reference to current object itself.

◆ operator==()

bool foxit::common::Barcode::operator== ( const Barcode other) const

Equal operator.

Parameters
[in]otherAnother Barcode object. This function will check if current object is equal to this one.
Returns
true means equal, while false means not equal.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.