I am looking at resizing an image (usually a larger PNG image) so that i can save it onto a single page of a PDF.
With the following code, the png gets distorted and is not true to aspect ratio. How would I resize the image before placing it on a pdf and keep it's aspect ratio.
//Drawing image to the PDF page
if (image.Height > page.Graphics.ClientSize.Height || image.Width > page.Graphics.ClientSize.Width)
{
page.Graphics.DrawImage(image, Syncfusion.Drawing.PointF.Empty, (document.Pages[0].GetClientSize()));
// page.Graphics.DrawImage(image, 0f, 0f, page.GetClientSize().Width, page.GetClientSize().Height);
}
else
{
page.Graphics.DrawImage(image, new Syncfusion.Drawing.PointF(0, 0));
}