There are some problems while saving the barcode image to stream in EMF format. This issue is not yet resolved. I will try to get back to you with more information. Sorry for the inconvenience.
This exception occurs while saving barcode images in EMF or WMF formats as these are not supported by the .NET framework. Please refer to http://support.microsoft.com/kb/316563 article for further details. If you save it to disk using the below statement, it actually saves the image in PNG format.
builder.Save(“test.emf”, ImageFormat.Emf); // works
It would take some time to provide an alternate solution for saving images in EMF format.
Is it possible for you to use other formats for saving images e.g. PNG or JPG?
Currently, we're investigating how we can improve the barcode quality when inserting the images into a Word document (by Aspose.Word) and then converting this to PDF (using non-Aspose-components like Acrobat destiller, save-as-PDF in Word ).
Image formats as BMP, PNG and especially JPEG sometimes cause results that are not usable.
GIF even seems to destroy the barcodes by spreading them across the document horizontally.
We already changed Word settings (suppressing compression at save, standard optimization) but this did not help.
Using vector graphics could help, couldn't it?
Please find attached some examples:
- the original Word document tmp000000010018972.docx (image quality is OK)
- PNG_default_pdf.pdf which uses PNG with default quality and PDF as taget format (not PDFA!)
- PNG_antialias_pdf.pdf which uses PNG with antialias quality and PDF as taget format (not PDFA!)