Request to update aspose words api to include aspose drawing bitmap

Hi Team,

Could you please provide us the updated aspose words api which includes aspose.drawing.bitmap , currently we have Skiasharp.skbitmap in IBarcodeGenerator interface. Because of this we are not able to increase the resolution of the barcode. So request you to provide us the aspose.words api so that we can increase the resolution of the barcode image and can decrease the size of the QR code.

Please let me know if you have any questions.

Appreciate your help.

Thanks
Vijay.

@vbhasker You can generate the barcode image using Aspose.Drawing, set the required image parameters, then save it to stream or byte array and finally decode the resulting image into SKBitmap:

// Generate barcode image using Aspose.Drawing.
// Save it to memorystream or to byte array.
// .......
// Decode barcode image into SKBitmap
SKBitmap barcodeBitmap = SKBitmap.Decode(barcodeImageByteArray);

Hi @alexey.noskov ,

Thanks for your reply!.

I tried generating barcode image using aspose.drawing.image and decoded to skbitmap and resized as well. still we are not able to see the exact image and the code text below qr code image is showing as blurred. I tried increasing resolution to 350 , 400 also.

Could you please let us know how do I get exact Image using aspose.drawing ands skiasharp.I have attached the expected image( which got generated from syste.drawing.image). due to security reasons we are not able to use system.drawing and using skiasharp.
Attached the custom barcode generator we are using and response pdf.

The below link was suggested in aspose.barcodes forum.
Reduce the size of the QR Code - Free Support Forum - aspose.com

CustomBarCodeGen07102023.zip (63.9 KB)

Appreciate your help!.

Thanks
–Vijay

@vbhasker The quality f the image is affected when you resize the image using SkiaSharp. If avoid resizing the quality is preserved:

SKBitmap IBarcodeGenerator.GetBarcodeImage(Aspose.Words.Fields.BarcodeParameters parameters)
{
    Aspose.Drawing.Image barCodeImage = GetBarcodeInImageFormat(parameters);
    MemoryStream barCodeImageByteArray = ConvertImageToByteArray(barCodeImage);
    return SKBitmap.Decode(barCodeImageByteArray);
}

So, simply create the barcode image of the required size and put it into SKBitmap without postprocessing. In this case barcode looks good: out.pdf (29.2 KB)

Hi @alexey.noskov, Thanks for looking into this. yes the quality is affected using resize with skiaSharp. I removed it but still getting bigger Image than expected with same set of parameters that are used for generating image with system.drawing.
in your attached output pdf, the text below QR code image is going to next line. we are expecting in one line only.
I have attached the updated custom bar code generator and expected and sample output that is coming now after change.

CustomBarCodeGen_07102023_1.zip (61.8 KB)

Thanks
–Vijay

@vbhasker

This is caused by barcode generator. You can save the barcode image to disc and you will notice the barcode text is wrapped.

Also, increasing resolution also increases the final image size, though in such case barcode text looks fine, the barcode image size is increased. So I suppose this either Aspose.Barcode or Aspose.Drawing issue.

Hi @alexey.noskov We are able to get the required smaller image size , can you please help us to auto fit the font in one line based on image size.

Thanks
–Vijay

NoWrap = true
FontMode = Manual
Font.Size = 6 or 4.
https://reference.aspose.com/barcode/net/aspose.barcode.generation/codetextparameters/

Also you can set UseAntiAlias to false
https://reference.aspose.com/barcode/net/aspose.barcode.generation/basegenerationparameters/

But it still is raster image, during resizing it loses details. We use resolution 300 dpi (or event 600dpi) to save image quality
https://docs.aspose.com/barcode/net/add-barcode-to-word-document/#using-cursor-position