I try to save a barcode made by Aspose.barcode to a stream conform documentation.
Conform the documentation I should use save(outStream, BarCodeImageFormat.Jpeg), but only inputstream is available as parameter.
I get this (compilation) error in code on the save method: The method save(InputStream, int) in the type BarCodeBuilder is not applicable for the arguments
(ByteArrayOutputStream, int)
The constructor ByteArrayOutputStream(ByteArrayOutputStream) is undefined
Now I write the image to disk and read it from disk. But I want to use it as a stream and copy the image of the barcode in a Word document.
my code is:
BarCodeBuilder bcdbuilder = **new** BarCodeBuilder();
//set code text
bcdbuilder.setCodeText(bcdWaarde);
//set symbology type
bcdbuilder.setSymbologyType(Symbology. *Code128* );
bcdbuilder.setxDimension(0.5f);
// Border will not be visible
bcdbuilder.setBorderVisible( **false** );
bcdbuilder.save( **new** ByteArrayOutputStream(dstStream), com.aspose.barcode.BarCodeImageFormat. *Png* );