Quantcast
Channel: Aspose.Pdf Product Family
Viewing all articles
Browse latest Browse all 3131

Image alignment does not work aspose pdf 10.3

$
0
0
I am using Aspose.Pdf version 10.3. I have the code snippet below. When the pdf is rendered the image is showing left justified, and not how I have aligned the image. Please help.

var tc = TypeDescriptor.GetConverter(typeof (Bitmap));
var ms = new MemoryStream();
var bitMap = (Bitmap) tc.ConvertFrom(imgStream);
bitMap.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
ms.Position = 0;

var img = new Aspose.Pdf.Image();
img.ImageStream = ms; //bitmap memory stream
img.HorizontalAlignment = HorizontalAlignment.Center;
var document = new Aspose.Pdf.Document();
document.Pages.Add();
document.Pages[1].Paragraphs.Add(img);

Viewing all articles
Browse latest Browse all 3131

Trending Articles