Foxit PDF SDK

Public Member Functions | Static Public Attributes | List of all members
com.foxit.sdk.common.Barcode Class Reference
Inheritance diagram for com.foxit.sdk.common.Barcode:

## Public Member Functions
| Barcode ()
| Constructor.
| Barcode (Barcode other)
| Constructor, with another barcode object. More...
synchronized void | delete ()
| Clean up related C++ resources immediately. More...
Bitmap | generateBitmap (String info, int format, int unit_width, int height, int level) throws com.foxit.sdk.PDFException
| Generate a barcode bitmap with a given information string and specified barcode format. More...
boolean | isEmpty ()
| Check whether current object is empty or not. More...
Public Member Functions inherited from com.foxit.sdk.common.Base
synchronized void | delete ()
| Clean up related C++ resources immediately. More...

## Static Public Attributes
static final int | e_FormatCode128 = 1
| Barcode format: Code128, including EAN128 code.
static final int | e_FormatCode39 = 0
| Barcode format: standard 39 code.
static final int | e_FormatEAN13 = 4
| Barcode format: EAN-13 code.
static final int | e_FormatEAN8 = 2
| Barcode format: EAN-8 code.
static final int | e_FormatITF = 5
| Barcode format: ITF code.
static final int | e_FormatPDF417 = 6
| Barcode format: PDF-417 code.
static final int | e_FormatQRCode = 7
| Barcode format: Quick Response Code.
static final int | e_FormatUPCA = 3
| Barcode format: UPC-A code.
static final int | e_QRCorrectionLevelHigh = 3
| The capability of recovery from 30% amounts of damage.
static final int | e_QRCorrectionLevelLow = 0
| The capability of recovery from 7% amounts of damage.
static final int | e_QRCorrectionLevelMedium = 1
| The capability of recovery from 15% amounts of damage.
static final int | e_QRCorrectionLevelQuater = 2
| The capability of recovery from 25% amounts of damage.

## Detailed Description

This class can be used to generate barcode bitmap.

## Constructor & Destructor Documentation

## ◆ Barcode()

com.foxit.sdk.common.Barcode.Barcode | ( | Barcode | other | ) |

Constructor, with another barcode object.

Parameters

  [in] | other | Another barcode object.

## Member Function Documentation

## ◆ delete()

synchronized void com.foxit.sdk.common.Barcode.delete | ( |  | ) |

Clean up related C++ resources immediately.

Returns
  None.

Note
  Once this function is called, current object cannot be used anymore.

## ◆ generateBitmap()

Bitmap com.foxit.sdk.common.Barcode.generateBitmap | ( | String | info,
|  | int | format,
|  | int | unit_width,
|  | int | height,
|  | int | level
| ) |  | throws com.foxit.sdk.PDFException

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

Parameters

  [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 com.foxit.sdk.common.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 com.foxit.sdk.common.Barcode.e_QRCorrectionLevelLow and this should be one of these values.

Returns
  A barcode bitmap.

## ◆ isEmpty()

boolean com.foxit.sdk.common.Barcode.isEmpty | ( |  | ) |

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.