Hi Team,
We are trying to generate a PDF from a word template which has a Barcode in it. In a Linux-Ubuntu environment we are seeing this error but in windows environment it works. Below is the error that we are seeing in Ubuntu
“Type”: “System.PlatformNotSupportedException”, “ExceptionMessage”: “System.Drawing.Common is not supported on this platform.”, “StackTrace”:" at System.Drawing.Font…ctor(String familyName, Single emSize, FontStyle style, GraphicsUnit unit)\n at \b.(Int32 , Int32 )\n at .(Int32 , Int32 , Int32 )\n at .( , AutoSizeMode , Int32 )\n at .( )\n at e.(BaseGenerationParameters )\n at e.()\n at Aspose.BarCode.Generation.BarcodeGenerator.GenerateBarCodeImage()\n at Rsi.Correspondence.Infrastructure.CustomBarcodeGenerator.GetBarcodeImage(BarcodeParameters
It looks like the error is been thrown from the BarCode Generetor class. Is this expected for .NET 6.0 and any workaround for this?
I have tried the workaround of setting the runtime config property in the above link but still i see same error.
In the same link i also see the below.
To use these APIs for cross-platform apps, migrate to one of the following libraries:
With the release Aspose.BarCode for .NET 23.2 (see the Release notes document), System.Drawing.Common in Aspose.Barcode for .NET (.NET Core) is replaced with Aspose.Drawing.Common. So, could you try it if it works for your needs. Please note, the version has not been published on Nuget repos. yet. Moreover, you may also manually download the Aspose.Drawing.Common library.
I have downloaded the above said Aspose.BarCode for .NET 23.2 and when i tried generating the document in the run time first i got the error that System.Text.Encoding.CodePages is not found so added it. Next got error Aspose.Drawing not found so added it.
Now i am seeing the error like below.
TypeLoadException: Could not load type ‘Aspose.Drawing.Bitmap’ from assembly ‘Aspose.Drawing, Version=23.2.0.0, Culture=neutral, PublicKeyToken=716fcc553a201e56’.
I tried checking for Bitmap Nuget/dll but couldnt get any. Could you please help me with how to get this resolved?
We have license of Aspose.Barcode and Aspose.Word. But as part the above implementation we had to add Aspose.Drawing.Common Nuget to get it working. So do we need to get the licenese for Aspose.Drawing.Common as well?
Also when is it expected to get the new Aspose.Barcode package as part of Nuget?
Yes, main idea that if you have any license of Aspose product which uses Aspose.Drawing.Common you do not need additional license for Aspose.Drawing.Common. But you can buy standalone Aspose.Drawing.Common license if you do not need any other Aspose product.
Aspose.Drawing.Common will be our graphic hub for all of Aspose.Barcode libraries. It already works well on Linux systems and we are working on adding support for .Net MAUI on Android and iOS.
PS
And yes, currently we have some problems with publishing Aspose.Barcode on nuget.