Aspose.Barcode for PHP via Java Generation and Recognition API docs

Inherits BaseJavaClass.

Public Member Functions

 __construct ($javaClass)
 
 getChecksumValidation ()
 
 setChecksumValidation (int $value)
 
 getStripFNC ()
 
 setStripFNC (bool $value)
 
 getDetectEncoding ()
 
 setDetectEncoding (bool $value)
 
 getAustraliaPost ()
 
- Public Member Functions inherited from BaseJavaClass
 getJavaClass ()
 
 getJavaClassName ()
 
 isNull ()
 
 printJavaClassName ()
 

Protected Member Functions

 init ()
 
- Protected Member Functions inherited from BaseJavaClass
 setJavaClass ($javaClass)
 

Private Attributes

 $_australiaPost
 

Detailed Description

The main BarCode decoding parameters. Contains parameters which make influence on recognized data.

Constructor & Destructor Documentation

◆ __construct()

BarcodeSettings::__construct (   $javaClass)

BarcodeSettings copy constructor

Parameters
BarcodeSettings | null$settingsThe source of the data
Exceptions
BarcodeException

Reimplemented from BaseJavaClass.

Member Function Documentation

◆ getAustraliaPost()

BarcodeSettings::getAustraliaPost ( )

Gets AustraliaPost decoding parameters

Returns
AustraliaPostSettings The AustraliaPost decoding parameters which make influence on recognized data of AustraliaPost symbology

◆ getChecksumValidation()

BarcodeSettings::getChecksumValidation ( )

Enable checksum validation during recognition for 1D and Postal barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar, PatchCode, Pharmacode, DataLogic2of5 Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, ItalianPost25, Matrix2of5, MSI, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies

$generator = new BarcodeGenerator(EncodeTypes::EAN_13, "1234567890128");
$generator->save("c:/test.png", BarcodeImageFormat::PNG);
$reader = new BarCodeReader("c:/test.png", null, DecodeType::EAN_13);
//checksum disabled
$reader->getBarcodeSettings()->setChecksumValidation(ChecksumValidation::OFF);
foreach($reader->readBarCodes() as $result)
{
echo ("BarCode CodeText: ".$result->getCodeText());
echo ("BarCode Value: " . $result->getExtended()->getOneD()->getValue());
echo ("BarCode Checksum: " . $result->getExtended()->getOneD()->getCheckSum());
}
$reader = new BarCodeReader("c:\\test.png", null, DecodeType::EAN_13);
//checksum enabled
$reader->getBarcodeSettings()->setChecksumValidation(ChecksumValidation::ON);
foreach($reader->readBarCodes() as $result)
{
echo ("BarCode CodeText: " . $result->CodeText);
echo ("BarCode Value: " . $result->getExtended()->getOneD()->getValue());
echo ("BarCode Checksum: " . $result->getExtended()->getOneD()->getCheckSum());
}
Returns
int Enable checksum validation during recognition for 1D and Postal barcodes.

◆ getDetectEncoding()

BarcodeSettings::getDetectEncoding ( )

The flag which force engine to detect codetext encoding for Unicode codesets. Default value is true.

$generator = new BarcodeGenerator(EncodeTypes::QR, "Слово"))
$im = $generator->generateBarcodeImage(BarcodeImageFormat::PNG);
//detects encoding for Unicode codesets is enabled
$reader = new BarCodeReader($im, DecodeType::QR);
$reader->getBarcodeSettings()->setDetectEncoding(true);
foreach($reader->readBarCodes() as $result)
echo ("BarCode CodeText: ".$result->getCodeText());
//detect encoding is disabled
$reader = new BarCodeReader($im, DecodeType::QR);
$reader->getBarcodeSettings()->setDetectEncoding(false);
foreach($reader->readBarCodes() as $result)
echo ("BarCode CodeText: ".$result->getCodeText());
Returns
bool The flag which force engine to detect codetext encoding for Unicode codesets

◆ getStripFNC()

BarcodeSettings::getStripFNC ( )

Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.

$generator = new BarcodeGenerator(EncodeTypes::GS_1_CODE_128, "(02)04006664241007(37)1(400)7019590754");
$generator->save("c:/test.png", BarcodeImageFormat::PNG);
$reader = new BarCodeReader("c:/test.png", DecodeType::CODE_128);
//StripFNC disabled
$reader->getBarcodeSettings()->setStripFNC(false);
foreach($reader->readBarCodes() as $result)
{
echo ("BarCode CodeText: ".$result->getCodeText());
}
$reader = new BarCodeReader("c:/test.png", DecodeType::CODE_128);
//StripFNC enabled
$reader->getBarcodeSettings()->setStripFNC(true);
foreach($reader->readBarCodes() as $result)
{
echo ("BarCode CodeText: ".$result->getCodeText());
}
Returns
bool Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.

◆ init()

BarcodeSettings::init ( )
protected

Reimplemented from BaseJavaClass.

◆ setChecksumValidation()

BarcodeSettings::setChecksumValidation ( int  $value)

Enable checksum validation during recognition for 1D and Postal barcodes. Default is treated as Yes for symbologies which must contain checksum, as No where checksum only possible. Checksum never used: Codabar, PatchCode, Pharmacode, DataLogic2of5 Checksum is possible: Code39 Standard/Extended, Standard2of5, Interleaved2of5, ItalianPost25, Matrix2of5, MSI, ItalianPost25, DeutschePostIdentcode, DeutschePostLeitcode, VIN Checksum always used: Rest symbologies

$generator = new BarcodeGenerator(EncodeTypes::EAN_13, "1234567890128");
$generator->save("c:/test.png", BarcodeImageFormat::PNG);
$reader = new BarCodeReader("c:/test.png", DecodeType::EAN_13);
//checksum disabled
$reader->getBarcodeSettings()->setChecksumValidation(ChecksumValidation::OFF);
foreach($reader->readBarCodes() as $result)
{
echo ("BarCode CodeText: ".$result->getCodeText());
echo ("BarCode Value: " . $result->getExtended()->getOneD()->getValue());
echo ("BarCode Checksum: " . $result->getExtended()->getOneD()->getCheckSum());
}
$reader = new BarCodeReader(@"c:\test.png", DecodeType::EAN_13);
//checksum enabled
$reader->getBarcodeSettings()->setChecksumValidation(ChecksumValidation::ON);
foreach($reader->readBarCodes() as $result)
{
echo ("BarCode CodeText: " . $result->CodeText);
echo ("BarCode Value: " . $result->getExtended()->getOneD()->getValue());
echo ("BarCode Checksum: " . $result->getExtended()->getOneD()->getCheckSum());
}
Parameters
int$valueEnable checksum validation during recognition for 1D and Postal barcodes.

◆ setDetectEncoding()

BarcodeSettings::setDetectEncoding ( bool  $value)

◆ setStripFNC()

BarcodeSettings::setStripFNC ( bool  $value)

Strip FNC1, FNC2, FNC3 characters from codetext. Default value is false.

$generator = new BarcodeGenerator(EncodeTypes::GS_1_CODE_128, "(02)04006664241007(37)1(400)7019590754");
$generator->save("c:/test.png", BarcodeImageFormat::PNG);
$reader = new BarCodeReader("c:/test.png", DecodeType::CODE_128);
//StripFNC disabled
$reader->getBarcodeSettings()->setStripFNC(false);
foreach($reader->readBarCodes() as $result)
{
echo ("BarCode CodeText: ".$result->getCodeText());
}
$reader = new BarCodeReader("c:/test.png", DecodeType::CODE_128);
//StripFNC enabled
$reader->getBarcodeSettings()->setStripFNC(true);
foreach($reader->readBarCodes() as $result)
{
echo ("BarCode CodeText: ".$result->getCodeText());
}
Parameters
bool$valueStrip FNC1, FNC2, FNC3 characters from codetext. Default value is false.

Member Data Documentation

◆ $_australiaPost

BarcodeSettings::$_australiaPost
private