When generating barcodes for ASP.NET Core, we need them as a Byte[] so that we can wrap them in a file content result. For example:
public FileContentResult Code128(string barcode)
{
var bc = new NetBarcode.Barcode(barcode, true);
var result = Convert.FromBase64String(bc.GetBase64Image());
Stream stream = new MemoryStream(result);
return new FileContentResult(result, "image/png");
}
Currently the way this is done is by asking Barcode to concert the image into a Byte[] which is then turned into a Base64 string, after which we turn it back into a Byte[],
When generating barcodes for ASP.NET Core, we need them as a Byte[] so that we can wrap them in a file content result. For example:
Currently the way this is done is by asking
Barcode
to concert the image into a Byte[] which is then turned into a Base64 string, after which we turn it back into a Byte[],This new method would just omit the Base64 step.