Free Support Forum -

Generate EMF barcode under Linux - the output is empty

now I am testing your barcode library, under Linux too. There I noticed, that the EMF outputs have a size of 0.
The same code under Windows works.

The code does not do much:

var generator = new BarcodeGenerator(GetEncodeType(type), data);

if (type == BarCodeType.QRCode || type == BarCodeType.SwissQRCode)
    generator.Parameters.Barcode.QR.QrErrorLevel = QRErrorLevel.LevelM;

generator.Parameters.CaptionAbove.Visible = false;
generator.Parameters.CaptionBelow.Visible = false;
generator.Parameters.Resolution = 300f;

generator.Parameters.ImageWidth.Millimeters = width;
generator.Parameters.ImageHeight.Millimeters = height;

// Save the Barcode image in JPEG format
generator.Save(outputDirectory + "output_Aspose_" + type + "." + 
GetBarCodeImageFormat(fileType), GetBarCodeImageFormat(fileType));

Here if the GetBarCodeImageFormat results BarCodeImageFormat.Emf under Linux, than is the output empty.
I am testing under Ubuntu 20.04.1 LTS, with the following barcode types: EncodeTypes.EAN13, EncodeTypes.Code128, EncodeTypes.GS1Code128, EncodeTypes.Pdf417, EncodeTypes.QR.

We have observed this issue and logged it in our database for further investigation. We will write back here once any update is ready for sharing.

This issue is logged as:
BARCODENET-37702 - Zero byte EMF file created in Linux