Random System.NullReferrenceException when creating barcodes

My code:

PdfCode128Barcode barcode = new PdfCode128Barcode();

barcode.BarHeight = 45;

barcode.Text = "MI23071507357";

var barcodeImage = barcode.ToImage( new SizeF(145, 45) );

1 out of five times I run this code I get a System.NullReferenceException with the following error stack trace:

 at Syncfusion.Pdf.Barcode.PdfUnidimensionalBarcode.GetSizeValue()

   at Syncfusion.Pdf.Barcode.PdfUnidimensionalBarcode.ToImage()

   at Syncfusion.Pdf.Barcode.PdfUnidimensionalBarcode.ToImage(SizeF size)


1 Reply

PR Preethi Rajakandham Syncfusion Team July 21, 2023 07:23 AM UTC

Hi Christiana,


A ticket has been created for the same issue. Therefore, please follow up on the ticket for further updates.


Regards,

Preethi R


Loader.
Up arrow icon