Foxit PDF SDK
|
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 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... | |
Barcode & | operator= (const Barcode &other) |
Assign operator. More... | |
bool | operator== (const Barcode &other) const |
Equal operator. More... | |
![]() | |
FS_HANDLE | Handle () const |
Get the handle of current object. More... | |
This class can be used to generate barcode bitmap.
Enumeration for barcode format.
Values of this enumeration should be used alone.
Enumeration for format error correction level of QR Code.
Values of this enumeration should be used alone.
foxit::common::Barcode::Barcode | ( | const Barcode & | other | ) |
Constructor, with another barcode object.
[in] | other | Another barcode object. |
common::Bitmap foxit::common::Barcode::GenerateBitmap | ( | const WString & | info, |
Format | format, | ||
int32 | unit_width, | ||
int32 | height, | ||
QRErrorCorrectionLevel | level | ||
) |
Generate a barcode bitmap with a given information string and specified barcode format.
[in] | info | Information string to be encoded to barcode bitmap. It should not be an empty string. |
[in] | format | Barcode 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_width | Unit 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. The width of the bitmap will be equal to the product of this parameter and the width of the info encoding. Specially, for PDF-417 and QR Code, height will be ignored, and the height of bitmap will be equal to the product of this parameter and the height of the info encoding. |
[in] | height | The height for bitmap, 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, height will be ignored, and the height of bitmap will be equal to the product of unit_width and the height of the info encoding. |
[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. |
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.
bool foxit::common::Barcode::operator!= | ( | const Barcode & | other | ) | const |
Not equal operator.
[in] | other | Another barcode object. This function will check if current object is not equal to this one. |
Assign operator.
[in] | other | Another barcode object, whose value would be assigned to current object. |
bool foxit::common::Barcode::operator== | ( | const Barcode & | other | ) | const |
Equal operator.
[in] | other | Another barcode object. This function will check if current object is equal to this one. |