On runtime we are getting the attached error ( method not found fontunit.set_style(aspose.drawing.fontstyle)), this seems to happen on project using .net standard 2.0.
I did test your scenario/case with latest Aspose.BarCode for .NET v23.12 using .NET6.0 project, it works fine and the output image (attached) is fine tuned. Here is the sample code that I am using:
e.g. Sample code:
Aspose.BarCode.Generation.BarcodeGenerator gen = new Aspose.BarCode.Generation.BarcodeGenerator(Aspose.BarCode.Generation.EncodeTypes.EAN13, "1234567890128");
gen.Parameters.Barcode.CodeTextParameters.Font.Style = Aspose.Drawing.FontStyle.Bold;
gen.Save("g:\\test2\\Ean13.png", Aspose.BarCode.Generation.BarCodeImageFormat.Png);
The issue does not occur on .net 6, it occurs when the barcode generator code is on a .net standard project and is accessed from a .netframework site. Attached is a sample test site were I managed to replicate the issue.
Thanks for the sample project and further details.
We need to evaluate your issue in details. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): BARCODENET-38877
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
Aspose.BarCode for all of .NETFramework versions uses System.Drawing instead of Aspose.Drawing.Common. Because, at this time, .NETFramework fully correctly works only on Windows and System.Drawing works well on Windows you can use:
Hi, thanks for the explaination, the problem is that on compilation it is expecting aspose.drawing since it is in a .net standard, even if at runtime it is running using .net framework. I even tried the code you supplied and it still does not work> attached the project with the updated code
Aspose.BarCode net47 uses System.Drawing. All of Aspose.BarCode .NETFramework versions use System.Drawing.
Aspose.Drawing is used only by .NETStandard 2.0 (netstandard2.0 folder), .NETStandard 2.1 (netstandard2.1 folder), net5.0, net6.0, net7.0 versions.
And we a working on article which can describe how to link Aspose.Drawing .NETStandard 2.0 library to .net 4.7.2 project in case of using Aspose.Drawing.
You can download .NET Dependency Walker, open lib\net47\Aspose.BarCode.dll and you can see the following dependencies
The main updates were to packages.config and TestSite.csproj. Because compiler does not know what version of the libraries you want to use you have to set required frameworks manually.
Some later we brought out the article in our documentation. At this time you can learn project example.