Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

KeySummaryCategory
BARCODENET-36791Prepare preview version of new barcode generation APINew Feature
BARCODENET-36872List or chart of prerequisites required to generate successful barcode image of any barcode type New Feature
BARCODENET-36941Implement UpcaGs1DatabarCoupon for new barcode generation API New Feature
BARCODENET-36930Implement Interpolation AutoSize mode New Feature
BARCODENET-36953Create User Control for new generation API New Feature
BARCODENET-36923Implement MaxiCode for new barcode generation API New Feature
BARCODENET-36922Implement DotCode for new barcode generation API New Feature
BARCODENET-36713Investigate new architecture of barcodes recognition filters. New Feature
BARCODENET-36940Implement UpcaGs1Code128Coupon for new barcode generation API New Feature
BARCODENET-36973Not able to read all barcodes from TIFF images New Feature
BARCODENET-36962Not able to read the barcode New Feature
BARCODENET-37013Deprecate BarCodeBuilder New Feature
BARCODENET-37019Add new barcode subsets to DecodeType New Feature
BARCODENET-36945Not able to detect barcode New Feature
BARCODENET-34367Improve the recognition of a 3D-distorted and rotated 2D-barcodes New Feature
BARCODENET-36389Improve the recognition of a 3D-distorted QR code New Feature
BARCODENET-37020Add minor fixes to BarCodeReader New Feature
BARCODENET-36648Improve WPF control appearance New Feature
BARCODENET-37026GS1 DataBar Expanded Stacked barcode did not pass GS1 Canda barcode verification (.NET)New Feature
BARCODENET-36215Unable to Read the DatabarExpandedStacked barcode from a PNG imageBug
BARCODENET-36942Incorrect draw Code16K barcode, without above and below borders Bug
BARCODENET-36952GS1 Datamatrix barcode is not wrapping the text in case of CodeLocation.Right Bug
BARCODENET-36946License is not working as embedded resource Bug
BARCODENET-36795DPI settings works incorrectly with rotation Bug
BARCODENET-36956Databars are generated incorrectly from GS1 string Bug
BARCODENET-37008ITF14 barcode fails GS1 Verification Process Bug
BARCODENET-34141Can't recognize DataMatrix codes from the JPG image Bug
BARCODENET-36957Text part isn't correct in ENA13 when change resolution Bug
BARCODENET-36786Aspose.BarCode is detecting only 1 out of 3 barcodes from PDF Bug
BARCODENET-37001Using same instance of BarcodeReader throws exceptions Bug
BARCODENET-37010Barcode CODE39 reading problem (.NET) Bug
BARCODENET-37000Barcode Detection does not constrain to the defined region. Bug
BARCODENET-37028MicrE13B for safe bitmap accessBug

Usage Examples

BARCODENET-36791 Prepare preview version of new barcode generation API
We would like to introduce the preview version of new barcode generation API. It has been developed to cover real use cases, like document printing and UI design, as well as we try to make it more simple then previous one. New class Aspose.BarCode.Generation.BarCodeGenerator has been added and it has following main features:
1. Two different modes of generation depending on your requirements.
If you have restricted requirements of barcode size, then you can set AutoSizeMode = Nearest and required barcode size. Barcode generator will calculate the all other parameters like xDimension, AspectRatio, etc to fit barcode into desired size:

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::QR, u"Aspose.BarCode sample");
generator->set_AutoSizeMode(Aspose::BarCode::Generation::AutoSizeMode::Nearest);
generator->get_BarCodeWidth()->set_Pixels(200);
generator->get_BarCodeHeight()->set_Pixels(200);
generator->Save(u"out.png");

 

In opposite if doesn't have required size, you can use AutoSizeMode = None and set all generator parameters by yourself.

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::QR, u"Aspose.BarCode sample");
generator->get_XDimension()->set_Pixels(3);
generator->get_Margins()->get_Left()->set_Pixels(20);
generator->get_Margins()->get_Right()->set_Pixels(20);
generator->Save(u"out.png");

 

In addition, if you just want to know the barcode size without saving image you can call method RecalculateValues() and get barcode size.

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::QR, u"Aspose.BarCode sample");
generator->get_XDimension()->set_Pixels(3);
generator->get_D2()->set_AspectRatio(1.5f);
generator->RecalculateValues();
float width = generator->get_BarCodeWidth()->get_Pixels();
float height = generator->get_BarCodeWidth()->get_Pixels();

 

Needless to say, that in the complex scenarios AutoSizeMode can be changed from None to Nearest and vice versa to cover all the requirements.

2. Unit-based system of values. All measurement values can be get and set in pixels, millimeters, inches in the same time. You can easily change the resolution of image and prepare the same barcode for printing, LCD screens or retina-displays.

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::QR, u"Aspose.BarCode sample");
generator->set_AutoSizeMode(Aspose::BarCode::Generation::AutoSizeMode::Nearest);
generator->get_BarCodeWidth()->set_Millimeters(20);
generator->get_BarCodeHeight()->set_Millimeters(20);
generator->Save(u"for_display.png");

generator->set_Resolution(300);
generator->Save(u"for_printer.png");

 

3. Properties for specific barcode types are grouped. Such specific properties like QR_EncodeType of DataMatrix_Ecc are grouped by type to simplify all the API for new users.

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::QR);
generator->get_QR()->set_Version(Aspose::BarCode::QRVersion::Version18);
generator->get_QR()->set_ErrorLevel(Aspose::BarCode::QRErrorLevel::LevelM);
generator->Save(u"qr.png");

 

4. BarCodeGenearator has predefined default codetext, so you can just explore the default codetext format for the specific type.

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::AustralianPosteParcel);
System::String codetext = generator->get_CodeText();//99712345678901234567890103456
Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::EAN13);
System::String codetext = generator->get_CodeText();//590123412345

 

5. Stay tuned, more features are coming soon! It is a preview version and your feedback are welcome. In the further releases we will add one more generation mode and new UI controls based on new API.

BARCODENET-36215 Unable to Read the DatabarExpandedStacked barcode from a PNG image
Sample

Code Block
System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(u"DatabarExpandedStacked_Sample.png", DecodeType::DatabarExpandedStacked);
while (reader->Read())
{
    System::Console::WriteLine(u"Type: {0} Text: {1}", reader->GetCodeType(), System::ObjectExt::Box<System::String>(reader->GetCodeText()));
}

 

Result:

No Format
Type: DatabarExpandedStacked Text: (8110)106141411234562891101201212085010048000214025610048000310123191000

 

BARCODENET-36941 - Implement UpcaGs1DatabarCoupon for new barcode generation API
Code sample:

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::UpcaGs1DatabarCoupon);
generator->Save(u"UpcaGs1DatabarCoupon.png");


Result:

No Format
Png image

 

BARCODENET-36930 - Implement Interpolation AutoSize mode
Code sample:

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::DataMatrix);
generator->set_AutoSizeMode(Aspose::BarCode::Generation::AutoSizeMode::Interpolation);
generator->get_BarCodeWidth()->set_Millimeters(50);
generator->get_BarCodeHeight()->set_Inches(1.3f);

System::SharedPtr<System::Drawing::Bitmap> barcode = generator->GenerateBarCodeImage();
barcode->Save(u"DataMatrix.png");

 

Result:

No Format
Png image


BARCODENET-36942 - Incorrect draw Code16K barcode, without above and below borders
Code sample:

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::Code16K);
generator->set_AutoSizeMode(Aspose::BarCode::Generation::AutoSizeMode::Nearest);
generator->get_BarCodeWidth()->set_Pixels(100);
generator->get_CodeTextStyle()->set_Location(Aspose::BarCode::CodeLocation::None);
generator->Save(u"Code16K_Nearest.png");


Result:

No Format
Png image


BARCODENET-36952 - GS1 Datamatrix barcode is not wrapping the text in case of CodeLocation.Right
We can use Display2DText property for only displayed text and we can insert '\n' symbols in this case.
Code sample:

Code Block
System::String CODICE = u"(90)0843110730<<<<452287005001T8";
System::String displayedText = System::String(u"(90)0843") + System::Environment::get_NewLine() +
                                u"110730<<<<" + System::Environment::get_NewLine() +
                                u"452287" + System::Environment::get_NewLine() +
                                u"005001T8" + System::Environment::get_NewLine();

System::SharedPtr<BarCodeBuilder> builder = System::MakeObject<BarCodeBuilder>(CODICE, EncodeTypes::GS1DataMatrix);

builder->set_CodeLocation(Aspose::BarCode::CodeLocation::Right);
builder->set_Display2DText(displayedText);

System::SharedPtr<System::Drawing::Bitmap> barcode = builder->GenerateBarCodeImage();
barcode->Save(u"Display2DText.png");

 

Result:

No Format
Png image


BARCODENET-36923 - Implement MaxiCode for new barcode generation API
Code sample:

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::MaxiCode);
generator->set_MaxiCodeEncodeMode(5);
System::SharedPtr<System::Drawing::Bitmap> barcode = generator->GenerateBarCodeImage();
barcode->Save(u"MaxiCode.png");

 

BARCODENET-36922 - Implement DotCode for new barcode generation API

 

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::DotCode);
generator->set_DotCodeMask(2);
System::SharedPtr<System::Drawing::Bitmap> barcode = generator->GenerateBarCodeImage();
barcode->Save(u"DotCode.png");

 

BARCODENET-36713 - Investigate new architecture of barcodes recognition filters.

 

Code Block
titleUsage of QualitySettings presets
System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(u"c:\\test.jpg");
//set high performance mode
reader->set_QualitySettings(QualitySettings::get_HighPerformance());
while (reader->Read())
{
    System::Console::WriteLine(System::String(u"BarCode CodeText: ") + reader->GetCodeText());
}
Code Block
titleUsage of QualitySettings Presets with Manual Options Set Up
System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(u"c:\\test.jpg");
//set high performance mode
reader->set_QualitySettings(QualitySettings::get_HighPerformance());
//set separate options
reader->get_QualitySettings()->set_AllowMedianSmoothing(true);
reader->get_QualitySettings()->set_MedianSmoothingWindowSize(5);
while (reader->Read())
{
    System::Console::WriteLine(System::String(u"BarCode CodeText: ") + reader->GetCodeText());
}
Code Block
titleUsage of QualitySettings Manual Options Set Up
System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(u"c:\\test.jpg");
//default mode is NormalQuality
//set separate options
reader->get_QualitySettings()->set_AllowMedianSmoothing(true);
reader->get_QualitySettings()->set_MedianSmoothingWindowSize(5);
while (reader->Read())
{
    System::Console::WriteLine(System::String(u"BarCode CodeText: ") + reader->GetCodeText());
}
Code Block
titleBitmap with Proceed Recangle Set Up Sample
System::SharedPtr<System::IO::FileStream> lStream = System::MakeObject<System::IO::FileStream>(u"c:\\test.jpg", System::IO::FileMode::Open, System::IO::FileAccess::Read, System::IO::FileShare::Read);

System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>();
reader->SetBarCodeImage(lStream);
while (reader->Read())
{
    System::Console::WriteLine(System::String(u"BarCode CodeText: ") + reader->GetCodeText());
}
Code Block
titleBitmap With Proceed Rectangles List Set Up Sample
System::SharedPtr<System::Drawing::Bitmap> lBitmap = System::MakeObject<System::Drawing::Bitmap>(u"c:\\test.jpg");

System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>();
reader->SetBarCodeImage(lBitmap, System::MakeArray<System::Drawing::Rectangle>({System::Drawing::Rectangle(0, 0, lBitmap->get_Width(), lBitmap->get_Height())}));
while (reader->Read())
{
    System::Console::WriteLine(System::String(u"BarCode CodeText: ") + reader->GetCodeText());
}

 


BARCODENET-36940 - Implement UpcaGs1Code128Coupon for new barcode generation API
Sample:

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::UpcaGs1Code128Coupon);

generator->set_CodeText(u"514141100906(01)88898765432109");

generator->set_AutoSizeMode(Aspose::BarCode::Generation::AutoSizeMode::Interpolation);
generator->get_BarCodeWidth()->set_Pixels(500);
generator->get_BarCodeHeight()->set_Pixels(200);

generator->Save(u"UpcaGs1Code128Coupon_Interpolation_500x200.png");


BARCODENET-36962 - Not able to read the barcode
QualitySettings.AllowInvertImage can help with such images:

Code Block
System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(fileName, DecodeType::DataMatrix);

reader->get_QualitySettings()->set_AllowInvertImage(true);

System::SharedPtr<System::Collections::Generic::List<System::String>> lCodetexts = System::MakeObject<System::Collections::Generic::List<System::String>>();
while (reader->Read())
{
    lCodetexts->Add(reader->GetCodeText());
}

ASPOSE_ASSERT_EQ(1, lCodetexts->get_Count());
ASSERT_TRUE(lCodetexts->Contains(u"65359403095957"));


BARCODENET-36795 - DPI settings works incorrectly with rotation
Sample:

Code Block
System::SharedPtr<BarCodeGenerator> generator = System::MakeObject<BarCodeGenerator>(EncodeTypes::Code128);
generator->set_Resolution(144);
generator->set_RotationAngle(90);
generator->Save(u"rotated_dpi144.png");

 

BARCODENET-37019 - Add new barcode subsets to DecodeType

Usage of the new DecodeType fields:

Code Block
System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(u"test.png", DecodeType::Types1D);
while (reader->Read())
{
    System::Console::WriteLine(System::ObjectExt::ToString(reader->GetCodeType()) + u" " + reader->GetCodeText());
}

System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(u"test.png", DecodeType::PostalTypes);
while (reader->Read())
{
    System::Console::WriteLine(System::ObjectExt::ToString(reader->GetCodeType()) + u" " + reader->GetCodeText());
}

System::SharedPtr<BarCodeReader> reader = System::MakeObject<BarCodeReader>(u"test.png", DecodeType::MostCommonTypes);
while (reader->Read())
{
    System::Console::WriteLine(System::ObjectExt::ToString(reader->GetCodeType()) + u" " + reader->GetCodeText());
}

 

Public API and Backward Incompatible Changes

...