Foxit PDF SDK
foxit::common::Barcode类 参考
类 foxit::common::Barcode 继承关系图:
foxit::Base

Public 类型

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
}
 条形码格式的枚举。 更多...
 
enum  QRErrorCorrectionLevel { e_QRCorrectionLevelLow = 0, e_QRCorrectionLevelMedium = 1, e_QRCorrectionLevelQuater = 2, e_QRCorrectionLevelHigh = 3 }
 QR 码错误纠正级别的枚举。 更多...
 

Public 成员函数

 Barcode ()
 构造函数。
 
 Barcode (const Barcode &other)
 拷贝构造函数,使用另一个条形码对象。 更多...
 
 ~Barcode ()
 析构函数。
 
common::Bitmap GenerateBitmap (const WString &info, Format format, int32 unit_width, int32 height, QRErrorCorrectionLevel level)
 使用给定的信息字符串和指定的条形码格式生成条形码位图。 更多...
 
bool IsEmpty () const
 检查当前对象是否为空。 更多...
 
bool operator != (const Barcode &other) const
 不相等操作符。 更多...
 
Barcodeoperator= (const Barcode &other)
 赋值操作符。 更多...
 
bool operator== (const Barcode &other) const
 相等操作符。 更多...
 
- Public 成员函数 继承自 foxit::Base
FS_HANDLE Handle () const
 获取当前对象的句柄。 更多...
 

详细描述

此类可用于生成条形码位图。

成员枚举类型说明

◆ Format

条形码格式的枚举。

此枚举的值应单独使用。

枚举值
e_FormatCode39 

条形码格式:标准 39 码。

e_FormatCode128 

条形码格式:Code128,包括 EAN128 码。

e_FormatEAN8 

条形码格式:EAN-8 码。

e_FormatUPCA 

条形码格式:UPC-A 码。

e_FormatEAN13 

条形码格式:EAN-13 码。

e_FormatITF 

条形码格式:ITF 码。

e_FormatPDF417 

条形码格式:PDF-417 码。

e_FormatQRCode 

条形码格式:快速响应码。

◆ QRErrorCorrectionLevel

QR 码错误纠正级别的枚举。

此枚举的值应单独使用。

枚举值
e_QRCorrectionLevelLow 

可恢复 7% 损坏数据的能力。

e_QRCorrectionLevelMedium 

可恢复 15% 损坏数据的能力。

e_QRCorrectionLevelQuater 

可恢复 25% 损坏数据的能力。

e_QRCorrectionLevelHigh 

可恢复 30% 损坏数据的能力。

构造及析构函数说明

◆ Barcode()

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

拷贝构造函数,使用另一个条形码对象。

参数
[in]other另一个条形码对象。

成员函数说明

◆ GenerateBitmap()

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

使用给定的信息字符串和指定的条形码格式生成条形码位图。

参数
[in]info要编码为条形码位图的信息字符串。不应为空字符串。
[in]format用于编码信息字符串的条形码格式。 请参考从 Barcode::e_FormatCode39 开始的值, 此参数应为这些值之一。
[in]unit_width条形码的单位宽度,单位为像素。有效值:从 1 到 5。如果输入值小于 1, 默认使用 1;如果输入值大于 5,默认使用 5。
位图的宽度将等于此参数与 info 编码宽度的乘积。 特别地,对于 PDF-417 和 QR 码,将忽略 height,位图的高度将 等于此参数与 info 编码高度的乘积。
[in]height位图的高度,单位为像素。有效值:等于或大于 20。 如果输入值小于 20,默认使用 20。
特别地,对于 PDF-417 和 QR 码,将忽略 height,位图的高度将 等于 unit_widthinfo 编码高度的乘积。
[in]level(仅对 QR 码必需)错误纠正级别。请参考从 Barcode::e_QRCorrectionLevelLow 开始的值,此参数应为这些值之一。
返回
条形码位图。

◆ IsEmpty()

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

检查当前对象是否为空。

当当前对象为空时,意味着当前对象无用。

返回
true 表示当前对象为空,false 表示非空。

◆ operator !=()

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

不相等操作符。

参数
[in]other另一个条形码对象。此函数将检查当前对象是否不等于此对象。
返回
true 表示不相等,false 表示相等。

◆ operator=()

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

赋值操作符。

参数
[in]other另一个条形码对象,其值将被赋给当前对象。
返回
当前对象本身的引用。

◆ operator==()

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

相等操作符。

参数
[in]other另一个条形码对象。此函数将检查当前对象是否等于此对象。
返回
true 表示相等,false 表示不相等。