Hello there
I am trying to create barcode using Pdf417 symbology. But its always creating exception
"Specified cast is not valid"
static void Main(string[] args)
{
Aspose.BarCode.BarCodeBuilder b;
b = new Aspose.BarCode.BarCodeBuilder();
b.SymbologyType = Aspose.BarCode.Symbology.Pdf417;
b.CodeText = “1234567890”;
//None of the following statements work
//I have added reference to System.Drawing
b.Save(“test_pdf417.bmp”, ImageFormat.Bmp);
b.Save(“test_pdf417.bmp”, System.Drawing.Imaging.ImageFormat.Bmp);
b.Save(“test_pdf417.bmp”, Aspose.BarCode.BarCodeImageFormat.Bmp);
}
Hi Sajjad,
Thank you for bringing this issue to our knowledge.
While using the latest version of Aspose.BarCode for .NET v4.7.0 (.net Framework 1.1), I am able to observe the said exception on my end. To investigate and rectify this problem, a ticket (BARCODENET-33192) has been logged in our bug tracking system, and has been attached to your request for tracking purposes. You will be automatically notified via this thread once a fix is available for public use.
Please note, this problem can only be observed with .net 1.1 version of Aspose.BarCode assembly and with Pdf417CompactionMode as Binary (if not explicitly specified or set as Auto). If you like you can avoid this situation for now, you may either upgrade the framework or you can explicitly specify the Pdf417CompactionMode as Text. Below is source code for your reference,
C#
Aspose.BarCode.BarCodeBuilder b;
b = new Aspose.BarCode.BarCodeBuilder();
b.SymbologyType = Aspose.BarCode.Symbology.Pdf417;
b.CodeText = “1234567890”;
b.Pdf417CompactionMode = Pdf417CompactionMode.Text;
b.Save(“test_pdf417IF.bmp”, System.Drawing.Imaging.ImageFormat.Bmp);
b.Save(“test_pdf417BIF.bmp”, Aspose.BarCode.BarCodeImageFormat.Bmp);
In case you have any further inquiries, please feel free to write back.
Regards,
The issues you have found earlier (filed as BARCODENET-33192) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.