Barcode

Definitions for barcode.
Definitions and functions in this module are included in fs_barcode_w.h.
Module: Barcode
License Identifier: Barcode/All
Available License Right: Writing. More...

Functions

FS_RESULT FSCRT_BCModule_Initialize ()
 Initialize barcode module. More...
 
FS_RESULT FSCRT_BCModule_Finalize ()
 Finalize barcode module. More...
 
FS_RESULT FSCRT_Barcode_GenerateBitmap (const FSCRT_BSTR *info, FS_INT32 codeFormat, FS_INT32 unitWidth, FS_INT32 unitHeight, FS_INT32 qrLevel, FSCRT_BITMAP *bitmap)
 Generate a bitmap of barcode with a given information string and a specific barcode format. More...
 

Macro Definitions for Barcode formats

#define FSCRT_BARCODEFORMAT_UNSPECIFIED   -1
 The format is unspecified.
 
#define FSCRT_BARCODEFORMAT_CODE_39   0
 The format is standard 39 code.
 
#define FSCRT_BARCODEFORMAT_CODE_128   1
 The format is Code128,includes EAN128 code.
 
#define FSCRT_BARCODEFORMAT_EAN_8   2
 The format is EAN-8 code.
 
#define FSCRT_BARCODEFORMAT_UPC_A   3
 The format is UPC-A code.
 
#define FSCRT_BARCODEFORMAT_EAN_13   4
 The format is EAN-13 code.
 
#define FSCRT_BARCODEFORMAT_ITF   5
 The format is ITF code.
 
#define FSCRT_BARCODEFORMAT_PDF_417   6
 The format is PDF-417 code.
 
#define FSCRT_BARCODEFORMAT_QR_CODE   7
 The format is Quick Response Code.
 

Macro Definitions for Format Error Correction Level of QR Code

#define FSCRT_BARCODE_QRERRORCORRECTION_L   0
 The capability of recovery from 7% amounts of damage.
 
#define FSCRT_BARCODE_QRERRORCORRECTION_M   1
 The capability of recovery from 15% amounts of damage.
 
#define FSCRT_BARCODE_QRERRORCORRECTION_Q   2
 The capability of recovery from 25% amounts of damage.
 
#define FSCRT_BARCODE_QRERRORCORRECTION_H   3
 The capability of recovery from 30% amounts of damage.
 

Detailed Description

Definitions for barcode.
Definitions and functions in this module are included in fs_barcode_w.h.
Module: Barcode
License Identifier: Barcode/All
Available License Right: Writing.

This module contains following features:

Function Documentation

FS_RESULT FSCRT_Barcode_GenerateBitmap ( const FSCRT_BSTR info,
FS_INT32  codeFormat,
FS_INT32  unitWidth,
FS_INT32  unitHeight,
FS_INT32  qrLevel,
FSCRT_BITMAP *  bitmap 
)

Generate a bitmap of barcode with a given information string and a specific barcode format.

Parameters
[in]infoPointer to a FSCRT_BSTR structure that is input content used to generate a bitmap. It should be valid.
[in]codeFormatBarcode format. Please refer to macro definitions FSCRT_BARCODEFORMAT_XXX and this should be one of these macros.
[in]unitWidthUnit width for barcode in pixels, and preferred value is 1-5 pixels. For QR Code, use min(unitWidth, unitHeight) instead of initial values.
[in]unitHeightUnit height for barcode in pixels, and preferred value is >= 20 pixels. For QR Code, use min(unitWidth, unitHeight) instead of initial values.
[in]qrLevelError correction level, required only for QR Code.
It should be one of the following macro definitions:
[out]bitmapPointer to a FSCRT_BITMAP handle that receives a bitmap handle generated by this function.
Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_PARAM if the parameter info, bitmap is NULL.
FSCRT_ERRCODE_INVALIDMODULE if the current barcode module is not initialized.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or generate a bitmap of barcode is not allowed.
FSCRT_ERRCODE_FORMAT if the parameter codeFormat contains unsupported format, or value in unitWidth, unitHeight, or qrLevel is invalid.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs internally.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_ERROR if any errors not covered as above occur.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
  • FSCRT_BCModule_Initialize should be called to initialize barcode module before any functions of barcode module are called.
  • Currently, for Windows8.1 store app and WindowsPhone 8.1 store app, this function does not support to generate a barcode with format FSCRT_BARCODEFORMAT_ITF.
Attention
Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
  • bitmap: this handle is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_BCModule_Finalize ( )

Finalize barcode module.

Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_INVALIDMANAGER if Foxit PDF SDK manager is not initialized.
FSCRT_ERRCODE_INVALIDMODULE if the current barcode module is not initialized.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or accessing barcode module is not allowed.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Function FSCRT_BCModule_Initialize should be called to initialize barcode module. This function should be called if no further process of barcode is needed.
Attention
Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.
FS_RESULT FSCRT_BCModule_Initialize ( )

Initialize barcode module.

This is the first function that should be called if applications need to process barcode.

Returns
FSCRT_ERRCODE_SUCCESS for success.
FSCRT_ERRCODE_INVALIDLICENSE if the current license is not authorized or accessing barcode module is not allowed.
FSCRT_ERRCODE_INVALIDMANAGER if Foxit PDF SDK manager is not initialized.
FSCRT_ERRCODE_UNRECOVERABLE if an unrecoverable error occurs internally.
FSCRT_ERRCODE_OUTOFMEMORY if there is not enough memory or invalid memory access.
FSCRT_ERRCODE_ERROR if the current barcode module cannot be intialized for any other reason.
For more error codes, please refer to macro definitions FSCRT_ERRCODE_XXX.
Note
Call function FSCRT_BCModule_Finalize to destroy barcode module if no further process of barcode is needed.
Attention
Thread Safety: this function is thread safe.
OOM Information:
OOM handling is only for mobile platforms, not for server or desktop.
  • This function is long-term recoverable.
Please refer to the document "Robust PDF Applications with Limited Memory" for more details.

Foxit Corporation