How to set Fixed width(500) and height(300) barcode size? I'm using Zxing library to generate barcode image.
private byte[] GenerateBarCodeZXing(string data)
{
var writer = new BarcodeWriter
{
Format = BarcodeFormat.PDF_417,
Options = new EncodingOptions { Width = 500, Height = 300, Margin=0 }
};
var imgBitmap = writer.Write(data);
using (var stream = new MemoryStream())
{
imgBitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png);
return stream.ToArray();
}
}
OutPut Image: