How to set image in pdf header itextsharp c#
<p>hi i am trying to set two images in pdf header, but the images are stretched, i can't set height of images as it is saying height is only read only property. the actual height of image is 80px and width is 120px. but the images are stretching how to avoid stretching.</p>

<p>my code is:</p>

<pre><code> public partial class MyEvent : PdfPageEventHelper
    {

        iTextSharp.text.Image image1;
        iTextSharp.text.Image image2;
        PdfPTable header = new PdfPTable(3);

        public override void OnOpenDocument(PdfWriter writer, Document document)
        {
            image1 = iTextSharp.text.Image.GetInstance(ReportManager.Properties.Settings.Default.RMCompanyLogo);

            image1.SetAbsolutePosition(20, (document.PageSize.Height - 120));
            image2 = iTextSharp.text.Image.GetInstance(ReportManager.Properties.Settings.Default.RMCompanyLogoOne);
            image2.SetAbsolutePosition((document.PageSize.Width) - (image2.Width + 20), 20);

            //header.WriteSelectedRows(0, -1, document.Left, document.Top, writer.DirectContent);

        }

        public override void OnEndPage(PdfWriter writer, Document document)
        {


            PdfPTable tbHeader = new PdfPTable(3);
            tbHeader.AddCell(image1);
            tbHeader.AddCell("Report Name");
            tbHeader.AddCell(image2);

            tbHeader.TotalWidth = document.PageSize.Width - 20;
            tbHeader.WriteSelectedRows(0, -1, 10, document.PageSize.Height - 15, writer.DirectContent);
        }

    }
</code></pre>

<p>i am getting result as below:</p>

<p><a href="https://i.stack.imgur.com/8CXxz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8CXxz.png" alt="enter image description here"></a></p>