im using itextsharp for exporting the image to pdf. ---- i want to make the edges of image smooth (curved edges), ---- and by itextsharp image property to get the image width and height(while getting the image from disk) ---- and also how to set the background color of the pdf page
following is for getting image and adding to pdf:
pdfDoc.Open();
//pdfDoc.Add(new iTextSharp.text.Paragraph("Welcome to dotnetfox"));
iTextSharp.text.Image gif = iTextSharp.text.Image.GetInstance(@"C:\Users\Admin\Desktop\logoall.bmp");
// gif.ScaleToFit(500, 100);
pdfDoc.Add(gif);
following is making grid to image and saving to disk:
Grid companysnapshot = values[0] as Grid; //companysnap shot
companysnapshot.Measure(new System.Windows.Size(double.PositiveInfinity, double.PositiveInfinity));
int companywidth = (int)Math.Round(companysnapshot.ActualWidth);
int companyheight = (int)Math.Round(companysnapshot.ActualHeight);
companywidth = companywidth == 0 ? 1 : companywidth;
companyheight = companyheight == 0 ? 1 : companyheight;
RenderTargetBitmap rtbmp = new RenderTargetBitmap(companywidth, companyheight, 96d, 96d, PixelFormats.Default);
rtbmp.Render(companysnapshot);
BmpBitmapEncoder encoder = new BmpBitmapEncoder();
encoder.Frames.Add(BitmapFrame.Create(rtbmp));
FileStream fs1 = File.Create(@"C:\Users\Admin\Desktop\companyss.bmp");
encoder.Save(fs1);
fs1.Close();
please code me out for this!!